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); } }
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); }
public FailingChildOuterActor(ActorRef inner) : base(inner) { Fail = new InnerActor(); }
public FailingChildInnerActor(ActorBase fail) : base(fail) { Fail = new InnerActor(); }