Ejemplo n.º 1
0
        internal ActorManager(
            ActorRegistration registration,
            ActorActivator activator,
            JsonSerializerOptions jsonSerializerOptions,
            ILoggerFactory loggerFactory,
            IActorProxyFactory proxyFactory,
            IDaprInteractor daprInteractor)
        {
            this.registration          = registration;
            this.activator             = activator;
            this.jsonSerializerOptions = jsonSerializerOptions;
            this.loggerFactory         = loggerFactory;
            this.proxyFactory          = proxyFactory;
            this.daprInteractor        = daprInteractor;

            this.timerManager = new DefaultActorTimerManager(this.daprInteractor);

            // map for remoting calls.
            this.methodDispatcherMap = new ActorMethodDispatcherMap(this.registration.Type.InterfaceTypes);

            // map for non-remoting calls.
            this.actorMethodInfoMap    = new ActorMethodInfoMap(this.registration.Type.InterfaceTypes);
            this.activeActors          = new ConcurrentDictionary <ActorId, ActorActivatorState>();
            this.reminderMethodContext = ActorMethodContext.CreateForReminder(ReceiveReminderMethodName);
            this.timerMethodContext    = ActorMethodContext.CreateForTimer(TimerMethodName);
            this.serializersManager    = IntializeSerializationManager(null);
            this.messageBodyFactory    = new WrappedRequestMessageFactory();

            this.logger = loggerFactory.CreateLogger(this.GetType());
        }
Ejemplo n.º 2
0
 public ActorRemotingClient(
     IDaprInteractor daprInteractor,
     IActorMessageBodySerializationProvider serializationProvider = null)
 {
     this.daprInteractor             = daprInteractor;
     this.serializersManager         = IntializeSerializationManager(serializationProvider);
     this.remotingMessageBodyFactory = this.serializersManager.GetSerializationProvider().CreateMessageBodyFactory();
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ActorHost"/> class.
 /// </summary>
 /// <param name="actorTypeInfo">The type information of the Actor.</param>
 /// <param name="id">The id of the Actor instance.</param>
 /// <param name="jsonSerializerOptions">The <see cref="JsonSerializerOptions"/> to use for actor state persistence and message deserialization.</param>
 /// <param name="loggerFactory">The logger factory.</param>
 /// <param name="proxyFactory">The <see cref="ActorProxyFactory" />.</param>
 /// <param name="daprInteractor">The <see cref="IDaprInteractor" />.</param>
 internal ActorHost(
     ActorTypeInformation actorTypeInfo,
     ActorId id,
     JsonSerializerOptions jsonSerializerOptions,
     ILoggerFactory loggerFactory,
     IActorProxyFactory proxyFactory,
     IDaprInteractor daprInteractor)
 {
     this.ActorTypeInfo  = actorTypeInfo;
     this.Id             = id;
     this.LoggerFactory  = loggerFactory;
     this.ProxyFactory   = proxyFactory;
     this.DaprInteractor = daprInteractor;
     this.StateProvider  = new DaprStateProvider(this.DaprInteractor, jsonSerializerOptions);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ActorProxyFactory"/> class.
 /// TODO: Accept Retry settings.
 /// </summary>
 public ActorProxyFactory()
 {
     // TODO: Allow configuration of serialization and client settings.
     this.daprInteractor = new DaprHttpInteractor();
 }
Ejemplo n.º 5
0
 public ActorNonRemotingClient(IDaprInteractor daprInteractor)
 {
     this.daprInteractor = daprInteractor;
 }
 public DefaultActorTimerManager(IDaprInteractor interactor)
 {
     this.interactor = interactor;
 }
Ejemplo n.º 7
0
 public DaprStateProvider(IDaprInteractor daprInteractor, JsonSerializerOptions jsonSerializerOptions = null)
 {
     this.jsonSerializerOptions = jsonSerializerOptions;
     this.daprInteractor = daprInteractor;
 }
Ejemplo n.º 8
0
 public DaprStateProvider(IDaprInteractor daprInteractor, IActorStateSerializer actorStateSerializer = null)
 {
     this.actorStateSerializer = actorStateSerializer;
     this.daprInteractor = daprInteractor;
 }