コード例 #1
0
ファイル: DeadActor.cs プロジェクト: oleduc/TheCapital
 public override void TickRare()
 {
     base.TickRare();
     if (Destroyed)
     {
         return;
     }
     if (Bugged)
     {
         Log.Error(this + " has null innerPawn. Destroying.");
         Destroy(DestroyMode.Vanish);
     }
     else
     {
         InnerActor.TickRare();
         if (vanishAfterTimestamp < 0)
         {
             vanishAfterTimestamp = Age + 6000000;
         }
         if (!ShouldVanish)
         {
             return;
         }
         Destroy(DestroyMode.Vanish);
     }
 }
コード例 #2
0
        public BookValidationActor(IActorRef bookTitleGuard)
        {
            InnerActor = Context.ActorOf(Props.Create <BookActor>(), Context.Self.Path.Name);

            Receive <CreateBook>(createBook =>
            {
                bookTitleGuard.Tell(new BookNameGuardActor.CheckBookTitleAvailability(createBook.Title));
                InnerActor.Tell(GetBook.Instance);

                Validate(createBook, new CreateBookValidator(), FillValidator);

                Case FillValidator(Case match, CreateBookValidator validator) => match
                .With <BookNameGuardActor.BookTitleAvailability>(x => validator.BookTitleAvailable = x.IsAvailable)
                .With <BookDto>(x => validator.Book = x);
            });

            Receive <AddTag>(addTag =>
            {
                InnerActor.Tell(GetBook.Instance);

                Validate(addTag, new AddTagValidator(), FillValidator);

                Case FillValidator(Case match, AddTagValidator validator) => match
                .With <BookDto>(x => validator.Book = x);
            });

            Receive <RemoveTag>(removeTag =>
            {
                InnerActor.Tell(GetBook.Instance);

                Validate(removeTag, new RemoveTagValidator(), FillValidator);

                Case FillValidator(Case match, RemoveTagValidator validator) => match
                .With <BookDto>(x => validator.Book = x);
            });

            ReceiveAny(Forward);
        }
コード例 #3
0
ファイル: ActorRefSpec.cs プロジェクト: rodrigovidal/akka.net
 public FailingChildOuterActor(ActorRef inner)
     : base(inner)
 {
     Fail = new InnerActor();
 }
コード例 #4
0
ファイル: ActorRefSpec.cs プロジェクト: rodrigovidal/akka.net
 public FailingChildInnerActor(ActorBase fail)
     : base(fail)
 {
     Fail = new InnerActor();
 }
コード例 #5
0
 public FailingChildOuterActor(ActorRef inner) : base(inner)
 {
     Fail = new InnerActor();
 }
コード例 #6
0
 public FailingChildInnerActor(ActorBase fail) : base(fail)
 {
     Fail = new InnerActor();
 }