Exemple #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());
        }
 public ActorServiceFactory(
     ActorTypeInformation actorTypeInformation,
     ActorMethodFriendlyNameBuilder methodFriendlyNameBuilder,
     Func <StatefulServiceContext, ActorTypeInformation, ActorService> actorServiceFactory,
     ActorMethodDispatcherMap methodDispatcherMap = null)
 {
     this.actorTypeInformation      = actorTypeInformation;
     this.methodDispatcherMap       = methodDispatcherMap;
     this.methodFriendlyNameBuilder = methodFriendlyNameBuilder;
     this.actorServiceFactory       = actorServiceFactory;
 }
Exemple #3
0
        internal ActorManager(ActorService actorService)
        {
            this.actorService = actorService;

            // map for remoting calls.
            this.methodDispatcherMap = new ActorMethodDispatcherMap(this.actorService.ActorTypeInfo.InterfaceTypes);

            // map for non-remoting calls.
            this.actorMethodInfoMap    = new ActorMethodInfoMap(this.actorService.ActorTypeInfo.InterfaceTypes);
            this.activeActors          = new ConcurrentDictionary <ActorId, Actor>();
            this.reminderMethodContext = ActorMethodContext.CreateForReminder(ReceiveReminderMethodName);
            this.timerMethodContext    = ActorMethodContext.CreateForReminder(TimerMethodName);
            this.serializersManager    = IntializeSerializationManager(null);
            this.messageBodyFactory    = new WrappedRequestMessageFactory();
        }
Exemple #4
0
 internal void InitializeInternal(ActorMethodDispatcherMap map, ActorMethodFriendlyNameBuilder methodNameBuilder)
 {
     this.methodDispatcherMap       = map;
     this.methodFriendlyNameBuilder = methodNameBuilder;
 }