本文整理汇总了C#中ActorPath类的典型用法代码示例。如果您正苦于以下问题:C# ActorPath类的具体用法?C# ActorPath怎么用?C# ActorPath使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ActorPath类属于命名空间,在下文中一共展示了ActorPath类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RoutedActorCell
public RoutedActorCell(ActorSystem system, InternalActorRef supervisor, Props routerProps, Props routeeProps, ActorPath path,
Mailbox mailbox)
: base(system, supervisor, routerProps, path, mailbox)
{
RouteeProps = routeeProps;
routerConfig = routerProps.RouterConfig;
Router = routerConfig.CreateRouter(system);
routerConfig.Match()
.With<Pool>(r =>
{
var routees = new List<Routee>();
for (int i = 0; i < r.NrOfInstances; i++)
{
var routee = this.ActorOf(RouteeProps);
routees.Add(new ActorRefRoutee(routee));
}
AddRoutees(routees.ToArray());
})
.With<Group>(r =>
{
var routees = routerConfig.GetRoutees(this).ToArray();
AddRoutees(routees);
});
Self = new RoutedActorRef(path, this);
}
示例2: Delivery
public Delivery(ActorPath destination, object message, DateTime timestamp, int attempt)
{
Destination = destination;
Message = message;
Timestamp = timestamp;
Attempt = attempt;
}
示例3: CreateFromStringAndToString
public void CreateFromStringAndToString()
{
string path ="abc\\def";
var ap = new ActorPath(path);
Assert.AreEqual(path, ap.ToString());
}
示例4: FutureActorRef
public FutureActorRef(TaskCompletionSource<object> result, ActorRef sender, Action unregister, ActorPath path)
{
_result = result;
_sender = sender ?? ActorRef.NoSender;
_unregister = unregister;
Path = path;
}
示例5: RootGuardianSupervisor
public RootGuardianSupervisor(RootActorPath root, IActorRefProvider provider, TaskCompletionSource<Status> terminationPromise, ILoggingAdapter log)
{
_log = log;
_terminationPromise = terminationPromise;
_provider = provider;
_path = root / "_Root-guardian-supervisor"; //In akka this is root / "bubble-walker"
}
示例6: RootGuardianActorRef
public RootGuardianActorRef(ActorSystemImpl system, Props props, MessageDispatcher dispatcher, Func<Mailbox> createMailbox, //TODO: switch from Func<Mailbox> createMailbox to MailboxType mailboxType
IInternalActorRef supervisor, ActorPath path, IInternalActorRef deadLetters, IReadOnlyDictionary<string, IInternalActorRef> extraNames)
: base(system,props,dispatcher,createMailbox,supervisor,path)
{
_deadLetters = deadLetters;
_extraNames = extraNames;
}
示例7: FutureActorRef
public FutureActorRef(TaskCompletionSource<object> result, ActorRef sender, Action unregister, ActorPath path)
{
this.result = result;
this.sender = sender;
this.unregister = unregister;
Path = path;
}
示例8: CreateFromParentAndToString
public void CreateFromParentAndToString()
{
var ap1 = new ActorPath("");
var ap2 = new ActorPath("test", ap1);
Assert.AreEqual("\\test", ap2.ToString());
}
示例9: Convert
public static SurrogateForActorPath Convert(ActorPath value)
{
if (value == null)
return null;
var path = ((ActorPath.Surrogate)value.ToSurrogate(CurrentSystem)).Path;
return new SurrogateForActorPath { Path = path };
}
示例10: WhenAddChild_ThenNewActorRefPathIncludesCurrentPlusChild
public void WhenAddChild_ThenNewActorRefPathIncludesCurrentPlusChild()
{
var actorPath = new ActorPath("root", null);
ActorPath childPath = actorPath.AddChild("child");
string[] elements = childPath.Elements.ToArray();
Assert.AreEqual("root", elements[0]);
Assert.AreEqual("child", elements[1]);
}
示例11: Setup
public void Setup(BenchmarkContext context)
{
_selectionOpCounter = context.GetCounter(ActorSelectionCounterName);
System = ActorSystem.Create("MailboxThroughputSpecBase" + Counter.GetAndIncrement());
_receiver = System.ActorOf(Props.Create(() => new BenchmarkActor(_selectionOpCounter, NumberOfMessages, _resetEvent)));
_receiverActorPath = _receiver.Path;
_oneMessageBenchmarkProps = Props.Create(() => new BenchmarkActor(_selectionOpCounter, 1, _resetEvent));
}
示例12: Lookup
public Deploy Lookup(ActorPath path)
{
if (path.Elements.Head() != "user" || path.Elements.Count() < 2)
return Deploy.None;
var elements = path.Elements.Drop(1);
return Lookup(elements);
}
示例13: EqualsTest
public void EqualsTest()
{
var ap1 = new ActorPath("");
var ap2 = new ActorPath("test", ap1);
var ap3 = new ActorPath("\\test");
Assert.IsTrue(ap2 == ap3);
Assert.IsFalse(ap1 == ap3);
}
示例14: RepointableActorRef
public RepointableActorRef(ActorSystemImpl system, Props props, MessageDispatcher dispatcher, MailboxType mailboxType, IInternalActorRef supervisor, ActorPath path)
{
System = system;
Props = props;
Dispatcher = dispatcher;
MailboxType = mailboxType;
Supervisor = supervisor;
_path = path;
}
示例15: Activate
async Task Activate(ActorPath path)
{
var system = ClusterActorSystem.Current;
actor = Activator.Activate(path.Type);
actor.Initialize(path.Id, system, this, ActorPrototype.Of(path.Type));
await actor.OnActivate();
}