Beispiel #1
0
        // Unwrap ICanTell from TRef

        public static ICanTell CastToICanTell(this InterfacedActorRef actor)
        {
            if (actor == null || actor.Target == null)
            {
                return(null);
            }

            return(((AkkaReceiverTarget)actor.Target).Receiver);
        }
        void IActorBoundGateway_NoReply.OpenChannel(Akka.Interfaced.InterfacedActorRef actor, object tag, Akka.Interfaced.SlimServer.ActorBindingFlags bindingFlags)
        {
            var requestMessage = new RequestMessage {
                InvokePayload = new IActorBoundGateway_PayloadTable.OpenChannel_2_Invoke {
                    actor = actor, tag = tag, bindingFlags = bindingFlags
                }
            };

            SendRequest(requestMessage);
        }
        void IActorBoundChannel_NoReply.BindActor(Akka.Interfaced.InterfacedActorRef actor, Akka.Interfaced.SlimServer.ActorBindingFlags bindingFlags)
        {
            var requestMessage = new RequestMessage {
                InvokePayload = new IActorBoundChannel_PayloadTable.BindActor_2_Invoke {
                    actor = actor, bindingFlags = bindingFlags
                }
            };

            SendRequest(requestMessage);
        }
        public Task <Akka.Interfaced.InterfacedActorRef> OpenChannel(Akka.Interfaced.InterfacedActorRef actor, object tag = null, Akka.Interfaced.SlimServer.ActorBindingFlags bindingFlags = (Akka.Interfaced.SlimServer.ActorBindingFlags) 0)
        {
            var requestMessage = new RequestMessage {
                InvokePayload = new IActorBoundGateway_PayloadTable.OpenChannel_2_Invoke {
                    actor = actor, tag = tag, bindingFlags = bindingFlags
                }
            };

            return(SendRequestAndReceive <Akka.Interfaced.InterfacedActorRef>(requestMessage));
        }
        public Task <Akka.Interfaced.InterfacedActorRef> BindActor(Akka.Interfaced.InterfacedActorRef actor, Akka.Interfaced.SlimServer.ActorBindingFlags bindingFlags = (Akka.Interfaced.SlimServer.ActorBindingFlags) 0)
        {
            var requestMessage = new RequestMessage {
                InvokePayload = new IActorBoundChannel_PayloadTable.BindActor_2_Invoke {
                    actor = actor, bindingFlags = bindingFlags
                }
            };

            return(SendRequestAndReceive <Akka.Interfaced.InterfacedActorRef>(requestMessage));
        }
        public static RequestMessage Request <T>(Action <T> action)
            where T : IInterfacedActor
        {
            var waiter   = new SinkRequestWaiter();
            var actorRef = InterfacedActorRef.Create(typeof(T));

            InterfacedActorRefModifier.SetRequestWaiter(actorRef, waiter);
            action((T)(object)actorRef);
            return(waiter.Message);
        }
Beispiel #7
0
        // Unwrap IActorRef from TRef

        public static IActorRef CastToIActorRef(this InterfacedActorRef actor)
        {
            return((IActorRef)(actor.CastToICanTell()));
        }
 public static void SetRequestWaiter(InterfacedActorRef actorRef, IRequestWaiter requestWaiter)
 {
     actorRef.RequestWaiter = requestWaiter;
 }
 public static void SetTarget(InterfacedActorRef actorRef, IRequestTarget target)
 {
     actorRef.Target = target;
 }
 public static void SetTimeout(InterfacedActorRef actorRef, TimeSpan?timeout)
 {
     actorRef.Timeout = timeout;
 }