예제 #1
0
        public static async Task <IActorRef> LookupAggregateActor <T>(this GridDomainNode node,
                                                                      string id,
                                                                      TimeSpan?timeout = null) where T : IAggregate
        {
            var name = EntityActorName.New <T>(id).Name;

            return(await node.ResolveActor($"{typeof(T).Name}_Hub/{name}", timeout));
        }
예제 #2
0
        public static async Task <IActorRef> LookupProcessActor <TProcess, TData>(this GridDomainNode node,
                                                                                  string id,
                                                                                  TimeSpan?timeout = null) where TData : IProcessState
        {
            var name = EntityActorName.New <TProcess>(id).Name;
            var type = typeof(TProcess).BeautyName();

            return(await node.ResolveActor($"{type}_Hub/{name}", timeout));
        }
예제 #3
0
        public static async Task KillProcessManager <TProcess, TState>(this GridDomainNode node, string id, TimeSpan?timeout = null)
            where TState : IProcessState
        {
            var hub = await node.LookupProcessHubActor <TProcess>(timeout);

            IActorRef processActor;

            try
            {
                processActor = await node.LookupProcessActor <TProcess, TState>(id, timeout);
            }
            catch
            {
                return;
            }

            await ShutDownHubActor(node, id, processActor, hub, timeout);

            var processStateHubActor = await node.ResolveActor($"{typeof(TState).Name}_Hub", timeout);

            var processStateActor = await node.ResolveActor($"{typeof(TState).Name}_Hub/" + EntityActorName.New <ProcessStateAggregate <TState> >(id), timeout);

            await ShutDownHubActor(node, id, processStateActor, processStateHubActor, timeout);
        }
예제 #4
0
 public static async Task <IActorRef> LookupProcessHubActor <TProcess>(this GridDomainNode node, TimeSpan?timeout = null)
 {
     return(await node.ResolveActor($"{typeof(TProcess).BeautyName()}_Hub", timeout));
 }
예제 #5
0
 public static async Task <IActorRef> LookupAggregateHubActor <T>(this GridDomainNode node, TimeSpan?timeout = null)
     where T : IAggregate
 {
     return(await node.ResolveActor($"{typeof(T).Name}_Hub", timeout));
 }