Esempio n. 1
0
        private async Task <UniqueIndexActor> CreateActor(IActorStateManager actorStateManager, string id)
        {
            var actorTypeInformation = ActorTypeInformation.Get(typeof(UniqueIndexActor));

            UniqueIndexActor actorFactory(ActorService service, ActorId id) =>
            new UniqueIndexActor(service, id, actorStateManager);

            var actorService            = new ActorService(actorTypeInformation, actorFactory);
            UniqueIndexActor actor      = actorFactory(actorService, new ActorId(id));
            MethodInfo       OnActivate = actor.GetType().GetMethod("OnActivateAsync", BindingFlags.NonPublic | BindingFlags.Instance);

            await(Task) OnActivate.Invoke(actor, Array.Empty <object>());
            return(actor);
        }