/// <summary> /// Register self as a named process /// </summary> /// <param name="name">Name to register under</param> public static ProcessId reg(ProcessName name) => ActorContext.Register(name, Self);
/// <summary> /// Register the name with the process /// </summary> /// <param name="name">Name to register under</param> /// <param name="process">Process to be registered</param> public static ProcessId reg(ProcessName name, ProcessId process) => ActorContext.Register(name, process);
/// <summary> /// Register the name with the process /// </summary> /// <param name="name">Name to register under</param> /// <param name="process">Process to be registered</param> public static Unit register(string name, ProcessId process) => ActorContext.Register(name, process);
/// <summary> /// Register the name with the process /// </summary> /// <typeparam name="T">The message type of the actor to register</typeparam> /// <param name="name">Name to register under</param> /// <param name="process">Process to be registered</param> public static ProcessId register <T>(ProcessName name, ProcessId process, ProcessFlags flags = ProcessFlags.Default) => ActorContext.Register <T>(name, process, flags);
/// <summary> /// Register self as a named process /// </summary> /// <remarks> /// This should be used from within a process' message loop only /// </remarks> /// <typeparam name="T">The message type of the actor to register</typeparam> /// <param name="name">Name to register under</param> public static ProcessId register <T>(ProcessName name, ProcessFlags flags = ProcessFlags.Default) => InMessageLoop ? ActorContext.Register <T>(name, Self, flags) : raiseUseInMsgLoopOnlyException <ProcessId>(nameof(name));
/// <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 = register("proc", pid); /// tell(Dispatch.Broadcast[regd], "Hello"); /// tell(Dispatch.First[regd], "Hello"); /// tell(Dispatch.LeastBusy[regd], "Hello"); /// tell(Dispatch.Random[regd], "Hello"); /// tell(Dispatch.RoundRobin[regd], "Hello"); /// /// </remarks> /// <param name="name">Name to register under</param> /// <param name="process">Process to be registered</param> /// <returns>A ProcessId that allows dispatching to the process(es). The result /// would look like /disp/reg/name</returns> public static ProcessId register(ProcessName name, ProcessId process) => ActorContext.Register($"{Role.Current.Value}-{name.Value}", process);
/// <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 = register("proc"); /// tell(Dispatch.Broadcast[regd], "Hello"); /// tell(Dispatch.First[regd], "Hello"); /// tell(Dispatch.LeastBusy[regd], "Hello"); /// tell(Dispatch.Random[regd], "Hello"); /// tell(Dispatch.RoundRobin[regd], "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(ProcessName name) => InMessageLoop ? ActorContext.Register($"{Role.Current.Value}-{name.Value}", Self) : raiseUseInMsgLoopOnlyException <ProcessId>(nameof(name));