Пример #1
0
 /// <summary>
 /// Register a named process (a kind of DNS for Processes).
 ///
 /// If the Process is visible to the cluster (PersistInbox) then the
 /// registration becomes a permanent named look-up until Process.deregister
 /// is called.
 ///
 /// See remarks.
 /// </summary>
 /// <remarks>
 /// Multiple Processes can register under the same name.  You may use
 /// a dispatcher to work on them collectively (wherever they are in the
 /// cluster).  i.e.
 ///
 ///     var regd = pid.Register(name);
 ///     Dispatch.Broadcast[regd].Tell("Hello");
 ///     Dispatch.First[regd].Tell("Hello");
 ///     Dispatch.LeastBusy[regd].Tell("Hello");
 ///     Dispatch.Random[regd].Tell("Hello");
 ///     Dispatch.RoundRobin[regd].Tell("Hello");
 /// </remarks>
 /// <param name="name">Name to register under</param>
 /// <returns>A ProcessId that allows dispatching to the process via the name.  The result
 /// would look like /disp/reg/name</returns>
 public static ProcessId Register(this ProcessId self, ProcessName name) =>
 ActorContext.Register(name, self);
Пример #2
0
 /// <summary>
 /// Register as a named process
 /// </summary>
 public static ProcessId Register <T>(this ProcessId self, ProcessName name, ProcessFlags flags = ProcessFlags.Default) =>
 ActorContext.Register <T>(name, self, flags);
Пример #3
0
 /// <summary>
 /// Register a named process (a kind of DNS for Processes).
 ///
 /// If the Process is visible to the cluster (PersistInbox) then the
 /// registration becomes a permanent named look-up until Process.deregister
 /// is called.
 ///
 /// See remarks.
 /// </summary>
 /// <remarks>
 /// Multiple Processes can register under the same name.  You may use
 /// a dispatcher to work on them collectively (wherever they are in the
 /// cluster).  i.e.
 ///
 ///     var regd = pid.Register(name);
 ///     Dispatch.Broadcast[regd].Tell("Hello");
 ///     Dispatch.First[regd].Tell("Hello");
 ///     Dispatch.LeastBusy[regd].Tell("Hello");
 ///     Dispatch.Random[regd].Tell("Hello");
 ///     Dispatch.RoundRobin[regd].Tell("Hello");
 ///
 ///     This should be used from within a process' message loop only
 /// </remarks>
 /// <param name="name">Name to register under</param>
 /// <returns>A ProcessId that allows dispatching to the process via the name.  The result
 /// would look like /disp/reg/name</returns>
 public static ProcessId Register(this ProcessId self) =>
 ActorContext.Register(self.GetName(), self);