本文整理匯總了C#中ActorSystem.FindActorByPath方法的典型用法代碼示例。如果您正苦於以下問題:C# ActorSystem.FindActorByPath方法的具體用法?C# ActorSystem.FindActorByPath怎麽用?C# ActorSystem.FindActorByPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ActorSystem
的用法示例。
在下文中一共展示了ActorSystem.FindActorByPath方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: AsyncStopActor
public void AsyncStopActor()
{
var actf = new ActorSystem();
var act1 = actf.CreateActor<AsyncTestActor>("parent");
var act2 = act1.Ask<ActorRef>(new createchildactormsg()).Result;
Assert.IsNotNull(actf.FindActorByPath("\\user\\parent\\child"));
bool f = false;
act1.Tell(new stopchildex() { child = act2,
childstopped = () => { f = true; } });
while (!f)
{
Thread.SpinWait(0);
}
Assert.IsNull(actf.FindActorByPath("\\user\\parent\\child"));
}
示例2: FindActorByPath
public void FindActorByPath()
{
var actf = new ActorSystem();
var act = actf.CreateActor<IerarhyTestActor>("myactor");
var act2 = act.Ask<ActorRef>(new createchildactormsg()).Result;
var fact = actf.FindActorByPath("\\user\\myactor\\child");
Assert.NotNull(fact);
Assert.AreEqual(act2, fact);
}
示例3: SystemStopTest
public void SystemStopTest()
{
var actf = new ActorSystem();
var act1 = actf.CreateActor<ChildStopRestartActor>("parent");
var act2 = act1.Ask<ActorRef>(new createchildactormsg()).Result;
var act3 = actf.FindActorByPath("\\user\\parent\\child");
Assert.AreEqual(act3, act2);
actf.StopSystem();
act3 = actf.FindActorByPath("\\user\\parent\\child");
Assert.IsNull(act3);
}