/// <summary> /// Initializes the newly created <c>Actor</c>. /// </summary> protected Actor() { var maybeEnvironment = ActorFactory.ThreadLocalEnvironment.Value; LifeCycle = new LifeCycle(maybeEnvironment ?? new TestEnvironment(), new Evictable(this)); ActorFactory.ThreadLocalEnvironment.Value = null; CompletesImpl = new ResultCompletes <object>(); }
internal ICompletesEventually CompletesEventually(ResultCompletes completes) { if (CompletesEventuallyAddress == null) { var completesEventually = Stage.World.CompletesFor(completes.ClientCompletes()); CompletesEventuallyAddress = completesEventually.Address; return(completesEventually); } return(Stage.World.CompletesFor(CompletesEventuallyAddress, completes.ClientCompletes())); }
public override ICompletes <O> With <O>(O outcome) { HasInternalOutcomeSet = true; InternalOutcome = outcome; if (!resultHolder.IsOfSameGenericType <O>()) { resultHolder = new ResultCompletes <O>(InternalClientCompletes, InternalOutcome, HasInternalOutcomeSet); } return((ICompletes <O>)resultHolder); }