Akka.Dispatch.Mailbox.SetActor C# (CSharp) Method

SetActor() public method

Attaches an ActorCell to the Mailbox.
public SetActor ( ActorCell actorCell ) : void
actorCell Akka.Actor.ActorCell
return void
        public virtual void SetActor(ActorCell actorCell)
        {
            _actorCell = actorCell;
        }

Usage Example

示例#1
0
        public void Setup(BenchmarkContext context)
        {
            MsgReceived = context.GetCounter("MsgReceived");
            System = ActorSystem.Create("PerfSys");
            Action<IActorDsl> actor = d => d.ReceiveAny((o, c) =>
            {
                MsgReceived.Increment();
            });
            TestActor = System.ActorOf(Props.Create(() => new Act(actor)), "testactor");
            var id = TestActor.Ask<ActorIdentity>(new Identify(null), TimeSpan.FromSeconds(3)).Result;

            Mailbox = new Mailbox(new UnboundedMessageQueue());
            Mailbox.SetActor(TestActor.AsInstanceOf<RepointableActorRef>().Underlying.AsInstanceOf<ActorCell>());
        }