private ActorManager CreateActorManager(Type type, ActorActivator activator = null)
        {
            var registration = new ActorRegistration(ActorTypeInformation.Get(type));
            var interactor   = new DaprHttpInteractor(clientHandler: null, "http://localhost:3500", apiToken: null);

            return(new ActorManager(registration, activator ?? new DefaultActorActivator(), JsonSerializerDefaults.Web, NullLoggerFactory.Instance, ActorProxy.DefaultProxyFactory, interactor));
        }
Beispiel #2
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());
        }
Beispiel #3
0
        private ActorManager CreateActorManager(Type type, ActorActivator activator = null)
        {
            var registration = new ActorRegistration(ActorTypeInformation.Get(type));

            return(new ActorManager(registration, activator ?? new DefaultActorActivator(), JsonSerializerDefaults.Web, NullLoggerFactory.Instance, ActorProxy.DefaultProxyFactory, new DaprHttpInteractor()));
        }
        private ActorManager CreateActorManager(Type type, ActorActivator activator = null)
        {
            var registration = new ActorRegistration(ActorTypeInformation.Get(type));

            return(new ActorManager(registration, activator ?? new DefaultActorActivator(), NullLoggerFactory.Instance));
        }