本文整理汇总了C#中Akka.Actor.ActorRef.Name方法的典型用法代码示例。如果您正苦于以下问题:C# ActorRef.Name方法的具体用法?C# ActorRef.Name怎么用?C# ActorRef.Name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Akka.Actor.ActorRef
的用法示例。
在下文中一共展示了ActorRef.Name方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PickUpFork
private void PickUpFork(ActorRef fork)
{
if (this.LeftFork == fork)
{
Console.WriteLine("{0} has {1} in his left hand", this.Self.Name(), fork.Name());
this.OwnsLeftFork = true;
}
else if(this.RightFork == fork)
{
Console.WriteLine("{0} has {1} in his right hand", this.Self.Name(), fork.Name());
this.OwnsRightFork = true;
}
if ((!this.OwnsLeftFork || !this.OwnsRightFork) &&
(this.random.Next(1) == 1))
{
this.DropFork(this.LeftFork);
this.DropFork(this.RightFork);
this.StartWaiting();
return;
}
this.StartEating();
}
示例2: AssignRightFork
private void AssignRightFork(ActorRef rightFork)
{
this.RightFork = rightFork;
Console.WriteLine("{0} is using {1} as his right fork", this.Self.Name(), rightFork.Name());
}
示例3: AssignLeftFork
private void AssignLeftFork(ActorRef leftFork)
{
this.LeftFork = leftFork;
Console.WriteLine("{0} is using {1} as his left fork", this.Self.Name(), leftFork.Name());
}