Exemplo n.º 1
0
 /// <summary>
 /// Initialize whencACtorProxy is created for Remoting.
 /// </summary>
 internal void Initialize(
     ActorRemotingClient client,
     ActorId actorId,
     string actorType)
 {
     this.actorRemotingClient     = client;
     this.ActorId                 = actorId;
     this.ActorType               = actorType;
     this.ActorMessageBodyFactory = client.GetRemotingMessageBodyFactory();
 }
Exemplo n.º 2
0
        /// <summary>
        /// Create a proxy, this method is also sued by ACtorReference also to create proxy.
        /// </summary>
        /// <param name="actorId">Actor Id.</param>
        /// <param name="actorInterfaceType">Actor Interface Type.</param>
        /// <param name="actorType">Actor implementation Type.</param>
        /// <returns>Returns Actor Proxy.</returns>
        internal object CreateActorProxy(ActorId actorId, Type actorInterfaceType, string actorType)
        {
            var remotingClient = new ActorRemotingClient(this.daprInteractor);
            var proxyGenerator = ActorCodeBuilder.GetOrCreateProxyGenerator(actorInterfaceType);
            var actorProxy     = proxyGenerator.CreateActorProxy();

            actorProxy.Initialize(remotingClient, actorId, actorType);

            return(actorProxy);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Initialize when ActorProxy is created for Remoting.
 /// </summary>
 internal void Initialize(
     ActorRemotingClient client,
     ActorId actorId,
     string actorType,
     ActorProxyOptions options)
 {
     this.actorRemotingClient     = client;
     this.ActorId                 = actorId;
     this.ActorType               = actorType;
     this.ActorMessageBodyFactory = client.GetRemotingMessageBodyFactory();
     this.JsonSerializerOptions   = options?.JsonSerializerOptions ?? this.JsonSerializerOptions;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Initialize when ActorProxy is created for Remoting.
 /// </summary>
 internal void Initialize(
     ActorRemotingClient client,
     ActorId actorId,
     string actorType,
     ActorProxyOptions options)
 {
     this.actorRemotingClient     = client;
     this.ActorId                 = actorId;
     this.ActorType               = actorType;
     this.ActorMessageBodyFactory = client.GetRemotingMessageBodyFactory();
     this.JsonSerializerOptions   = options?.JsonSerializerOptions ?? new JsonSerializerOptions(JsonSerializerDefaults.Web);
     this.DaprApiToken            = options?.DaprApiToken;
 }