/// <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(); }
/// <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); }
/// <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; }
/// <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; }