Esempio n. 1
0
 public static T Proxy <T>(this ActorId id, Uri serviceUri = null) where T : IActor
 {
     if (id == null)
     {
         throw new NullReferenceException($"Proxy<{typeof(T).FullName}> identity is null");
     }
     if (serviceUri == null)
     {
         serviceUri = ServiceUriHelper.Resolve <T>();
     }
     return(ActorProxy.Create <T>(id, serviceUri));
 }
Esempio n. 2
0
        public static async Task <bool> DeleteActor <T>(this ActorId id, Uri serviceUri = null) where T : IActor
        {
            CancellationToken token = new CancellationToken();

            if (serviceUri == null)
            {
                serviceUri = ServiceUriHelper.Resolve <T>();
            }
            var            proxy             = id.Proxy <T>(serviceUri);
            ActorReference actorReference    = ActorReference.Get(proxy);
            var            actorServiceProxy = ActorServiceProxy.Create(actorReference.ServiceUri, id);
            await actorServiceProxy.DeleteActorAsync(id, token);

            return(await Task.FromResult(true));
        }