- AppProfile
- DeadLetter
- create (ProcessId sender, ProcessId recipient, Exception ex, string reason, object message)
- create (ProcessId sender, ProcessId recipient, string reason, object message)
- create (ProcessId sender, ProcessId recipient, Exception ex, object message)
- create (ProcessId sender, ProcessId recipient, object message)
- Sender
- Recipient
- Exception
- Reason
- Message
- ContentDisplay
- ContentTypeDisplay
- ToString ()
- Dispatch
- register (ProcessName name, Func<ProcessId, IEnumerable<ProcessId>> selector)
- deregister (ProcessName name)
- broadcast (IEnumerable<ProcessId> processIds)
- leastBusy (IEnumerable<ProcessId> processIds)
- random (IEnumerable<ProcessId> processIds)
- roundRobin (IEnumerable<ProcessId> processIds)
- broadcast (ProcessId processId, params ProcessId[] processIds)
- leastBusy (ProcessId processId, params ProcessId[] processIds)
- random (ProcessId processId, params ProcessId[] processIds)
- roundRobin (ProcessId processId, params ProcessId[] processIds)
- getFunc (ProcessName name)
- getFuncOption (ProcessName name)
- HasEcho <RT>
- NamedProcessAlreadyExistsException
- NamedProcessAlreadyExistsException ()
- NamedProcessAlreadyExistsException (string message)
- NamedProcessAlreadyExistsException (string message, Exception innerException)
- InvalidSystemNameException
- InvalidSystemNameException ()
- InvalidSystemNameException (string message)
- InvalidSystemNameException (string message, Exception innerException)
- InvalidProcessNameException
- InvalidProcessNameException ()
- InvalidProcessNameException (string message)
- InvalidProcessNameException (string message, Exception innerException)
- InvalidProcessIdException
- InvalidProcessIdException ()
- InvalidProcessIdException (string message)
- InvalidProcessIdException (string message, Exception innerException)
- NoChildProcessesException
- NoChildProcessesException ()
- NoChildProcessesException (string message)
- NoChildProcessesException (string message, Exception innerException)
- AskException
- ProcessException
- Self
- Sender
- ProcessException (string message, string self, string sender, Exception innerException)
- ProcessException (string message, string self, string sender)
- ProcessSetupException
- ProcessKillException
- ProcessKillException ()
- ProcessKillException (string message)
- ProcessKillException (string message, Exception innerException)
- ProcessInboxFullException
- ProcessSessionExpired
- NoRouterWorkersException
- ProcessConfigException
- ProcessConfigException ()
- ProcessConfigException (string message)
- ProcessConfigException (string message, Exception innerException)
- QueueFullException
- QueueFullException ()
- QueueFullException (string message)
- QueueFullException (string message, Exception innerException)
- ClientDisconnectedException
- Id
- ClientDisconnectedException (ClientConnectionId id)
- ClientDisconnectedException (ClientConnectionId id, string message)
- ClientDisconnectedException (ClientConnectionId id, string message, Exception innerException)
- ProcessSystemException
- IProcess <in T>
- JsonBinder
- BindToType (string asm, string tyname)
- BindToName (Type serializedType, out string assemblyName, out string typeName)
- Process
- ask <T> (ProcessId pid, object message, ProcessId sender)
- ask <T> (ProcessId pid, object message)
- askAsync <R> (ProcessId pid, object message, ProcessId sender)
- askIfAlive <T> (ProcessId pid, object message, ProcessId sender)
- askIfAlive <T> (ProcessId pid, object message)
- askAsync <R> (ProcessId pid, object message)
- askChildren <T> (object message, int take = Int32.MaxValue)
- askParent <T> (object message)
- askChild <T> (ProcessName name, object message)
- askChild <T> (int index, object message)
- ProcessConfig
- initialiseWeb (IEnumerable<FuncSpec> strategyFuncs = null)
- initialiseWeb (Action setup, IEnumerable<FuncSpec> strategyFuncs = null)
- initialiseWeb (string nodeName, IEnumerable<FuncSpec> strategyFuncs = null)
- initialiseWeb (string nodeName, Action setup, IEnumerable<FuncSpec> strategyFuncs = null, string appPath = null)
- initialiseFileSystem (string nodeName, IEnumerable<FuncSpec> strategyFuncs = null)
- initialiseFileSystem (Action setup, IEnumerable<FuncSpec> strategyFuncs = null)
- initialiseFileSystem (IEnumerable<FuncSpec> strategyFuncs = null)
- initialiseFileSystem (string nodeName, Action setup, IEnumerable<FuncSpec> strategyFuncs = null, string appPath = null)
- initialise ()
- initialise ( SystemName systemName, ProcessName roleName, ProcessName nodeName, string connectionString, string catalogueName, string providerName = "redis" )
- initialise (string configText, Option<string> nodeName, Action setup = null, IEnumerable<FuncSpec> strategyFuncs = null)
- read <T> (string name, string prop, T defaultValue, SystemName system = default(SystemName))
- read <T> (string name, T defaultValue)
- readList <T> (string name, string prop = "value")
- readMap <T> (string name, string prop = "value")
- write (string name, object value)
- write (string name, string prop, object value, SystemName system = default(SystemName))
- clear (string name, string prop, SystemName system = default(SystemName))
- clear (SystemName system = default(SystemName))
- Process
- dead (object message, string reason, SystemName system = default(SystemName))
- dead (object message, Exception ex, SystemName system = default(SystemName))
- dead (object message, Exception ex, string reason, SystemName system = default(SystemName))
- dead (string reason, SystemName system = default(SystemName))
- dead (Exception ex, SystemName system = default(SystemName))
- dead (Exception ex, string reason, SystemName system = default(SystemName))
- Process
- fwd <T> (ProcessId pid, T message)
- fwd (ProcessId pid)
- fwdChild <T> (ProcessName name, T message)
- fwdChild <T> (int index, T message)
- fwdChild (ProcessName name)
- fwdChild (int index)
- Process
- Process
- logWarn (string message)
- logUserErr (string message)
- logErr (Exception ex)
- logErr (string message, Exception ex)
- logErr (string message)
- Process
- spawnRoundRobin <T> ( ProcessName Name, int Count, Action<T> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize )
- spawnRoundRobin <S, T> ( ProcessName Name, int Count, Func<S> Setup, Func<S, T, S> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize )
- Process
- publish <T> (T message)
- publish <T> (T message, TimeSpan delayFor)
- publish <T> (T message, DateTime delayUntil)
- subscribe (ProcessId pid)
- unsubscribe (ProcessId pid)
- subscribe <T> (ProcessId pid, IObserver<T> observer)
- subscribe <T> (ProcessId pid, Action<T> onNext, Action<Exception> onError, Action onComplete)
- subscribe <T> (ProcessId pid, Action<T> onNext, Action<Exception> onError)
- subscribe <T> (ProcessId pid, Action<T> onNext)
- subscribe <T> (ProcessId pid, Action<T> onNext, Action onComplete)
- observe <T> (ProcessId pid)
- observeUnsafe <T> (ProcessId pid)
- observeState <T> (ProcessId pid)
- observeStateUnsafe <T> (ProcessId pid)
- subscribeState <T> (ProcessId pid)
- Process
- queryRegistered (ProcessName role, string keyQuery, SystemName system = default(SystemName))
- queryProcesses (string keyQuery, SystemName system = default(SystemName))
- queryProcessMetaData (string keyQuery, SystemName system = default(SystemName))
- Process
- find (ProcessName name)
- find (ProcessName role, ProcessName name)
- register (ProcessName name, SystemName system = default(SystemName))
- register (ProcessName name, ProcessId process)
- deregisterById (ProcessId process)
- deregisterByName (ProcessName name, SystemName system = default(SystemName))
- Process
- noreply = NoReturn.Default
- reply <T> (T message)
- replyIfAsked <T> (T message)
- replyError (Exception exception)
- replyError (string errorMessage)
- replyErrorIfAsked (Exception exception)
- replyErrorIfAsked (string errorMessage)
- replyOrTellSender <T> (T message)
- Process
- SessionEnded = sessionEnded
- SessionStarted = sessionStarted
- sessionStart (SessionId sid, Time timeout, SystemName system)
- sessionStart (SessionId sid, Time timeout)
- sessionStart (Time timeout)
- sessionStop ()
- sessionTouch ()
- sessionTouch (SessionId sid)
- setSession (SessionId sid)
- sessionId ()
- sessionSetData (string key, object value)
- sessionClearData (string key)
- sessionGetData <T> (string key)
- hasSession ()
- withSession <R> (SessionId sid, Func<R> f)
- withSession (SessionId sid, Action f)
- hasActiveSession ()
- addSupplementarySession (SupplementarySessionId sid)
- getSessionBySupplementaryId (SupplementarySessionId sid)
- getSupplementarySessionId ()
- provideSupplementarySessionId ()
- Process
- spawn <T> ( ProcessName Name, Action<T> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, Action<ProcessId> Terminated = null )
- spawnUnit <T> ( ProcessName Name, Func<T, Unit> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, Func<ProcessId, Unit> Terminated = null )
- spawn <S, T> ( ProcessName Name, Func<S> Setup, Func<S, T, S> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, Func<S, ProcessId, S> Terminated = null, Func<S, Unit> Shutdown = null, SystemName System = default(SystemName), bool Lazy = false )
- spawnMany <T> ( int Count, ProcessName Name, Action<T> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, Action<ProcessId> Terminated = null )
- spawnMany <S, T> ( int Count, ProcessName Name, Func<S> Setup, Func<S, T, S> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, Func<S, Unit> Shutdown = null, Func<S, ProcessId, S> Terminated = null )
- spawnMany <S, T> ( ProcessName Name, HashMap<int, Func<S>> Spec, Func<S, T, S> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, Func<S, Unit> Shutdown = null, Func<S, ProcessId, S> Terminated = null )
- spawn <TProcess,TMsg> ( ProcessName Name, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize )
- proxy <TProcess> (ProcessId pid)
- spawn <TProcessInterface> ( ProcessName Name, Func<TProcessInterface> Setup, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize )
- spawn <TProcess> ( ProcessName Name, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize )
- Process
- Process
- tell <T> (ProcessId pid, T message, ProcessId sender = default(ProcessId))
- tell <T> (ProcessId pid, T message, Schedule schedule, ProcessId sender = default(ProcessId))
- tell <T> (ProcessId pid, T message, TimeSpan delayFor, ProcessId sender = default(ProcessId))
- tell <T> (ProcessId pid, T message, DateTime delayUntil, ProcessId sender = default(ProcessId))
- tellChildren <T> (T message, ProcessId sender = default(ProcessId))
- tellChildren <T> (T message, Schedule schedule, ProcessId sender = default(ProcessId))
- tellChildren <T> (T message, TimeSpan delayFor, ProcessId sender = default(ProcessId))
- tellChildren <T> (T message, DateTime delayUntil, ProcessId sender = default(ProcessId))
- tellChildren <T> (T message, Func<ProcessId, bool> predicate, ProcessId sender = default(ProcessId))
- tellChildren <T> (T message, Schedule schedule, Func<ProcessId, bool> predicate, ProcessId sender = default(ProcessId))
- tellChildren <T> (T message, TimeSpan delayFor, Func<ProcessId, bool> predicate, ProcessId sender = default(ProcessId))
- tellChildren <T> (T message, DateTime delayUntil, Func<ProcessId, bool> predicate, ProcessId sender = default(ProcessId))
- tellParent <T> (T message, ProcessId sender = default(ProcessId))
- tellParent <T> (T message, Schedule schedule, ProcessId sender = default(ProcessId))
- tellParent <T> (T message, TimeSpan delayFor, ProcessId sender = default(ProcessId))
- tellParent <T> (T message, DateTime delayUntil, ProcessId sender = default(ProcessId))
- tellSelf <T> (T message, ProcessId sender = default(ProcessId))
- tellSelf <T> (T message, Schedule schedule, ProcessId sender = default(ProcessId))
- tellSelf <T> (T message, TimeSpan delayFor, ProcessId sender = default(ProcessId))
- tellSelf <T> (T message, DateTime delayUntil, ProcessId sender = default(ProcessId))
- tellChild <T> (ProcessName name, T message, ProcessId sender = default(ProcessId))
- tellChild <T> (int index, T message, ProcessId sender = default(ProcessId))
- Process
- Process
- PreShutdown
- Shutdown
- ProcessSystemLog
- Self
- Parent
- Root (SystemName system = default(SystemName))
- User (SystemName system = default(SystemName))
- DeadLetters (SystemName system = default(SystemName))
- Errors (SystemName system = default(SystemName))
- Sender
- Children
- ChildrenInOrder
- children (ProcessId pid)
- childrenInOrder (ProcessId pid)
- child (ProcessName name)
- child (int index)
- SelfProcessCancellationToken
- kill ()
- shutdown ()
- kill (ProcessId pid)
- startup (ProcessId pid)
- shutdown (ProcessId pid)
- shutdownSystem (SystemName system)
- shutdownAll ()
- restart (ProcessId pid)
- pause (ProcessId pid)
- pauseFor (ProcessId pid, Time delay)
- unpause (ProcessId pid)
- exists (ProcessId pid)
- ping (ProcessId pid)
- watch (ProcessId pid)
- unwatch (ProcessId pid)
- watch (ProcessId watcher, ProcessId watching)
- unwatch (ProcessId watcher, ProcessId watching)
- inboxCount (ProcessId pid)
- isTell
- ClusterNodes (SystemName system = default(SystemName))
- ClusterNodes24 (SystemName system = default(SystemName))
- Systems
- isAsk
- resolve (ProcessId pid)
- validMessageTypes (ProcessId pid)
- reschedule (ProcessId pid, string key, DateTime when)
- reschedule (ProcessId pid, string key, TimeSpan when)
- cancelScheduled (ProcessId pid, string key)
- Process <RT>
- ask <A> (ProcessId pid, object message, ProcessId sender = default(ProcessId))
- ask <A> (Eff<RT, ProcessId> pid, object message, ProcessId sender = default(ProcessId))
- askChildren <A> (object message, int take = Int32.MaxValue)
- askParent <A> (object message)
- askChild <A> (ProcessName name, A message)
- askChild <A> (int index, object message)
- Process <RT>
- System
- Self
- Parent
- Sender
- User
- DeadLetters
- Root
- Errors
- Children
- ChildrenInOrder
- children (ProcessId pid)
- childrenInOrder (ProcessId pid)
- child (ProcessName name)
- child (int index)
- killSelf
- shutdownSelf
- kill (ProcessId pid)
- startup (ProcessId pid)
- shutdown (ProcessId pid)
- shutdownSystem (SystemName system)
- shutdownAll
- restart (ProcessId pid)
- pause (ProcessId pid)
- pauseFor (ProcessId pid, Time delay)
- unpause (ProcessId pid)
- exists (ProcessId pid)
- ping (ProcessId pid)
- watch (ProcessId pid)
- unwatch (ProcessId pid)
- watch (ProcessId watcher, ProcessId watching)
- unwatch (ProcessId watcher, ProcessId watching)
- inboxCount (ProcessId pid)
- isTell
- assertTell
- ClusterNodes
- Systems
- isAsk
- assertAsk
- resolve (ProcessId pid)
- validMessageTypes (ProcessId pid)
- reschedule (ProcessId pid, string key, DateTime when)
- reschedule (ProcessId pid, string key, TimeSpan when)
- cancelScheduled (ProcessId pid, string key)
- Process <RT>
- find (ProcessName name)
- find (ProcessName role, ProcessName name)
- register (ProcessName name)
- register (ProcessName name, ProcessId process)
- deregisterById (ProcessId process)
- deregisterByName (ProcessName name)
- Process <RT>
- noreply = NoReturn.Default
- reply <A> (A message)
- replyIfAsked <A> (A message)
- replyError (Exception exception)
- replyError (string errorMessage)
- replyErrorIfAsked (Exception exception)
- replyErrorIfAsked (string errorMessage)
- replyOrTellSender <A> (A message)
- Process <RT>
- spawn <T> ( ProcessName Name, Func<T, Aff<RT, Unit>> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, Func<ProcessId, Aff<RT, Unit>> Terminated = null)
- spawnUnit <T> ( ProcessName Name, Func<T, Aff<RT, Unit>> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, Func<ProcessId, Aff<RT, Unit>> Terminated = null)
- spawn <S, T> ( ProcessName Name, Aff<RT, S> Setup, Func<S, T, Aff<RT, S>> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, Func<S, ProcessId, Aff<RT, S>> Terminated = null, Func<S, Aff<RT, Unit>> Shutdown = null, bool Lazy = false)
- spawnMany <T> ( int Count, ProcessName Name, Func<T, Aff<RT, Unit>> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, Func<ProcessId, Aff<RT, Unit>> Terminated = null)
- spawnMany <S, T> ( int Count, ProcessName Name, Aff<RT, S> Setup, Func<S, T, Aff<RT, S>> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, Func<S, Aff<RT, Unit>> Shutdown = null, Func<S, ProcessId, Aff<RT, S>> Terminated = null)
- spawnMany <S, T> ( ProcessName Name, HashMap<int, Aff<RT, S>> Spec, Func<S, T, Aff<RT, S>> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, Func<S, Aff<RT, Unit>> Shutdown = null, Func<S, ProcessId, Aff<RT, S>> Terminated = null)
- Process <RT>
- spawn <T> ( ProcessName Name, Func<T, Eff<RT, Unit>> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, Func<ProcessId, Eff<RT, Unit>> Terminated = null)
- spawnUnit <T> ( ProcessName Name, Func<T, Eff<RT, Unit>> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, Func<ProcessId, Eff<RT, Unit>> Terminated = null)
- spawn <S, T> ( ProcessName Name, Eff<RT, S> Setup, Func<S, T, Eff<RT, S>> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, Func<S, ProcessId, Eff<RT, S>> Terminated = null, Func<S, Eff<RT, Unit>> Shutdown = null, bool Lazy = false)
- spawnMany <T> ( int Count, ProcessName Name, Func<T, Eff<RT, Unit>> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, Func<ProcessId, Eff<RT, Unit>> Terminated = null)
- spawnMany <S, T> ( int Count, ProcessName Name, Eff<RT, S> Setup, Func<S, T, Eff<RT, S>> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, Func<S, Eff<RT, Unit>> Shutdown = null, Func<S, ProcessId, Eff<RT, S>> Terminated = null)
- spawnMany <S, T> ( ProcessName Name, HashMap<int, Eff<RT, S>> Spec, Func<S, T, Eff<RT, S>> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, Func<S, Eff<RT, Unit>> Shutdown = null, Func<S, ProcessId, Eff<RT, S>> Terminated = null)
- Process <RT>
- tell <A> (ProcessId pid, A message, ProcessId sender = default(ProcessId))
- tell <A> (Eff<RT, ProcessId> pid, A message, ProcessId sender = default(ProcessId))
- tell <A> (ProcessId pid, A message, Schedule schedule, ProcessId sender = default(ProcessId))
- tell <A> (Eff<RT, ProcessId> pid, A message, Schedule schedule, ProcessId sender = default(ProcessId))
- tell <A> (ProcessId pid, A message, TimeSpan delayFor, ProcessId sender = default(ProcessId))
- tell <A> (Eff<RT, ProcessId> pid, A message, TimeSpan delayFor, ProcessId sender = default(ProcessId))
- tell <A> (ProcessId pid, A message, DateTime delayUntil, ProcessId sender = default(ProcessId))
- tell <A> (Eff<RT, ProcessId> pid, A message, DateTime delayUntil, ProcessId sender = default(ProcessId))
- tellChildren <A> (A message, ProcessId sender = default(ProcessId))
- tellChildren <A> (A message, Schedule schedule, ProcessId sender = default(ProcessId))
- tellChildren <A> (A message, TimeSpan delayFor, ProcessId sender = default(ProcessId))
- tellChildren <A> (A message, DateTime delayUntil, ProcessId sender = default(ProcessId))
- tellChildren <A> (A message, Func<ProcessId, bool> predicate, ProcessId sender = default(ProcessId))
- tellChildren <A> (A message, Schedule schedule, Func<ProcessId, bool> predicate, ProcessId sender = default(ProcessId))
- tellChildren <A> (A message, TimeSpan delayFor, Func<ProcessId, bool> predicate, ProcessId sender = default(ProcessId))
- tellChildren <A> (A message, DateTime delayUntil, Func<ProcessId, bool> predicate, ProcessId sender = default(ProcessId))
- tellParent <A> (A message, ProcessId sender = default(ProcessId))
- tellParent <A> (A message, Schedule schedule, ProcessId sender = default(ProcessId))
- tellParent <A> (A message, TimeSpan delayFor, ProcessId sender = default(ProcessId))
- tellParent <A> (A message, DateTime delayUntil, ProcessId sender = default(ProcessId))
- tellSelf <A> (A message, ProcessId sender = default(ProcessId))
- tellSelf <A> (A message, Schedule schedule, ProcessId sender = default(ProcessId))
- tellSelf <A> (A message, TimeSpan delayFor, ProcessId sender = default(ProcessId))
- tellSelf <A> (A message, DateTime delayUntil, ProcessId sender = default(ProcessId))
- tellChild <A> (ProcessName name, A message, ProcessId sender = default(ProcessId))
- tellChild <A> (int index, A message, ProcessId sender = default(ProcessId))
- ProcessAssert
- CanAccept <T> (ProcessId pid, string message = null)
- HasStateTypeOf <T> (ProcessId pid, string message = null)
- ProcessFlags
- ProcessHub
- RouteValidator
- Connections
- OpenConnection (string remoteIp, Action<ClientMessageDTO> tell)
- EnsureConnection (ClientConnectionId id, Action<ClientMessageDTO> tell)
- CloseConnection (ClientConnectionId id)
- TouchConnection (ClientConnectionId id)
- Subscribe (ClientConnectionId id, ProcessId pub, ProcessId sub)
- UnSubscribe (ClientConnectionId id, ProcessId pub, ProcessId sub)
- ProcessId
- System
- Path
- ProcessId (string path)
- TryParse (string path)
- this []
- this []
- Child (ProcessName name)
- Child (IEnumerable<ProcessId> name)
- IsSelection
- GetSelection ()
- Parent
- ToString ()
- GetHashCode ()
- IsValid
- Name
- NoSender = new ProcessId()
- None = new ProcessId()
- Sep = '/'
- Equals (ProcessId other)
- Equals (object obj)
- == (ProcessId lhs, ProcessId rhs)
- != (ProcessId lhs, ProcessId rhs)
- CompareTo (ProcessId other)
- CompareTo (object obj)
- Skip (int count)
- Take (int count)
- HeadName ()
- Head ()
- Tail ()
- Count ()
- Append (ProcessId pid)
- Top = new ProcessId(Sep.ToString())
- SetSystem (SystemName system)
- StartsWith (ProcessId head)
- ProcessIdExtensions
- GetChildren (this ProcessId self)
- GetChild (this ProcessId self, ProcessName name)
- GetChild (this ProcessId self, int index)
- Register (this ProcessId self)
- Register (this ProcessId self, ProcessName name)
- Kill (this ProcessId self)
- Shutdown (this ProcessId self)
- Ask <T> (this ProcessId pid, object message)
- Subscribe (this ProcessId pid)
- Unsubscribe (this ProcessId pid)
- Subscribe <T> (this ProcessId pid, IObserver<T> observer)
- Subscribe <T> (this ProcessId pid, Action<T> onNext, Action<Exception> onError, Action onComplete)
- Subscribe <T> (this ProcessId pid, Action<T> onNext, Action<Exception> onError)
- Subscribe <T> (this ProcessId pid, Action<T> onNext)
- Subscribe <T> (this ProcessId pid, Action<T> onNext, Action onComplete)
- Observe <T> (this ProcessId pid)
- ObserveState <T> (this ProcessId pid)
- SubscribeState <T> (this ProcessId pid)
- Tell <T> (this ProcessId pid, T message, ProcessId sender = default(ProcessId))
- Tell <T> (this ProcessId pid, T message, TimeSpan delayFor, ProcessId sender = default(ProcessId))
- Tell <T> (this ProcessId pid, T message, DateTime delayUntil, ProcessId sender = default(ProcessId))
- Tell <T> (this ProcessId pid, T message, Echo.Schedule schedule, ProcessId sender = default(ProcessId))
- ProcessLogItemType
- ProcessLogItem
- When
- Type
- Message
- Exception
- ProcessLogItem (ProcessLogItemType type, string message, Exception exception)
- ProcessLogItem (ProcessLogItemType type, string message)
- ProcessLogItem (ProcessLogItemType type, Exception exception)
- TypeDisplay
- DateDisplay
- ToString ()
- ProcessName
- Value
- InvalidNameChars = append<MArray<char>, char[]>(System.IO.Path.GetInvalidFileNameChars(), new[] { '[', ']', ',' }).Distinct().ToArray()
- ProcessName (string value)
- IsValid
- TryParse (string value)
- FromSelection (IEnumerable<ProcessId> pids)
- IsSelection
- GetSelection ()
- ToString ()
- GetHashCode ()
- Equals (ProcessName other)
- CompareTo (ProcessName other)
- CompareTo (object obj)
- == (ProcessName lhs, ProcessName rhs)
- != (ProcessName lhs, ProcessName rhs)
- Equals (object obj)
- Role
- Current
- Broadcast
- LeastBusy
- Random
- RoundRobin
- First
- Second
- Third
- Last
- Next (SystemName system = default(SystemName))
- Prev (SystemName system = default(SystemName))
- NodeIds (ProcessId leaf)
- Nodes (ProcessId leaf, SystemName system = default(SystemName))
- Router
- broadcast <S, T> ( ProcessName Name, int Count, Func<S> Setup, Func<S, T, S> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" )
- broadcast <T> ( ProcessName Name, IEnumerable<ProcessId> Workers, RouterOption Options = RouterOption.Default, ProcessFlags Flags = ProcessFlags.Default, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize )
- broadcastMap <S, T, U> ( ProcessName Name, int Count, Func<S> Setup, Func<S, U, S> Inbox, Func<T, U> Map, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" )
- broadcastMap <T, U> ( ProcessName Name, IEnumerable<ProcessId> Workers, Func<T,U> Map, RouterOption Options = RouterOption.Default, ProcessFlags Flags = ProcessFlags.Default, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize )
- broadcastMapMany <S, T, U> ( ProcessName Name, int Count, Func<S> Setup, Func<S, U, S> Inbox, Func<T, IEnumerable<U>> MapMany, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" )
- broadcastMapMany <T, U> ( ProcessName Name, IEnumerable<ProcessId> Workers, Func<T, IEnumerable<U>> MapMany, RouterOption Options = RouterOption.Default, ProcessFlags Flags = ProcessFlags.Default, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize )
- broadcast <T> ( ProcessName Name, int Count, Action<T> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" )
- broadcastMap <T, U> ( ProcessName Name, int Count, Action<U> Inbox, Func<T, U> Map, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" )
- broadcastMapMany <T, U> ( ProcessName Name, int Count, Action<U> Inbox, Func<T, IEnumerable<U>> MapMany, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" )
- Router
- DefaultHashFunction <TMsg> ()
- hash <S, T> ( ProcessName Name, int Count, Func<S> Setup, Func<S, T, S> Inbox, Func<int, T, int> HashFunc = null, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" )
- hash <T> ( ProcessName Name, IEnumerable<ProcessId> Workers, Func<int, T, int> HashFunc = null, RouterOption Options = RouterOption.Default, ProcessFlags Flags = ProcessFlags.Default, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize )
- hashMap <S, T, U> ( ProcessName Name, int Count, Func<S> Setup, Func<S, U, S> Inbox, Func<T, U> Map, Func<int, T, int> HashFunc = null, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" )
- hashMap <T, U> ( ProcessName Name, IEnumerable<ProcessId> Workers, Func<T, U> Map, Func<int, U, int> HashFunc = null, RouterOption Options = RouterOption.Default, ProcessFlags Flags = ProcessFlags.Default, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize )
- hashMapMany <S, T, U> ( ProcessName Name, int Count, Func<S> Setup, Func<S, U, S> Inbox, Func<T, IEnumerable<U>> MapMany, Func<int, U, int> HashFunc = null, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" )
- hashMapMany <T, U> ( ProcessName Name, IEnumerable<ProcessId> Workers, Func<T, IEnumerable<U>> MapMany, Func<int, U, int> HashFunc = null, RouterOption Options = RouterOption.Default, ProcessFlags Flags = ProcessFlags.Default, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize )
- hash <T> ( ProcessName Name, int Count, Action<T> Inbox, Func<int, T, int> HashFunc = null, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" )
- hashMap <T, U> ( ProcessName Name, int Count, Action<U> Inbox, Func<T, U> Map, Func<int, T, int> HashFunc = null, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" )
- hashMapMany <T, U> ( ProcessName Name, int Count, Action<U> Inbox, Func<T, IEnumerable<U>> MapMany, Func<int, U, int> HashFunc = null, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" )
- Router
- leastBusy <S, T> ( ProcessName Name, int Count, Func<S> Setup, Func<S, T, S> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" )
- leastBusy <T> ( ProcessName Name, IEnumerable<ProcessId> Workers, RouterOption Options = RouterOption.Default, ProcessFlags Flags = ProcessFlags.Default, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize )
- leastBusyMap <S, T, U> ( ProcessName Name, int Count, Func<S> Setup, Func<S, U, S> Inbox, Func<T, U> Map, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" )
- leastBusyMap <T, U> ( ProcessName Name, IEnumerable<ProcessId> Workers, Func<T, U> Map, RouterOption Options = RouterOption.Default, ProcessFlags Flags = ProcessFlags.Default, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize )
- leastBusy <T> ( ProcessName Name, int Count, Action<T> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" )
- leastBusyMap <T, U> ( ProcessName Name, int Count, Action<U> Inbox, Func<T, U> Map, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" )
- Router
- random <S, T> ( ProcessName Name, int Count, Func<S> Setup, Func<S, T, S> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" )
- random <T> ( ProcessName Name, IEnumerable<ProcessId> Workers, RouterOption Options = RouterOption.Default, ProcessFlags Flags = ProcessFlags.Default, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize )
- randomMap <S, T, U> ( ProcessName Name, int Count, Func<S> Setup, Func<S, U, S> Inbox, Func<T, U> Map, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" )
- randomMap <T, U> ( ProcessName Name, IEnumerable<ProcessId> Workers, Func<T, U> Map, RouterOption Options = RouterOption.Default, ProcessFlags Flags = ProcessFlags.Default, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize )
- randomMapMany <S, T, U> ( ProcessName Name, int Count, Func<S> Setup, Func<S, U, S> Inbox, Func<T, IEnumerable<U>> MapMany, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" )
- randomMapMany <T, U> ( ProcessName Name, IEnumerable<ProcessId> Workers, Func<T, IEnumerable<U>> MapMany, RouterOption Options = RouterOption.Default, ProcessFlags Flags = ProcessFlags.Default, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize )
- random <T> ( ProcessName Name, int Count, Action<T> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" )
- randomMap <T, U> ( ProcessName Name, int Count, Action<U> Inbox, Func<T, U> Map, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" )
- randomMapMany <T, U> ( ProcessName Name, int Count, Action<U> Inbox, Func<T, IEnumerable<U>> MapMany, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" )
- Router
- roundRobin <S, T> ( ProcessName Name, int Count, Func<S> Setup, Func<S, T, S> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" )
- roundRobin <T> ( ProcessName Name, IEnumerable<ProcessId> Workers, RouterOption Options = RouterOption.Default, ProcessFlags Flags = ProcessFlags.Default, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize )
- roundRobinMap <S, T, U> ( ProcessName Name, int Count, Func<S> Setup, Func<S, U, S> Inbox, Func<T, U> Map, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" )
- roundRobinMap <T, U> ( ProcessName Name, IEnumerable<ProcessId> Workers, Func<T, U> Map, RouterOption Options = RouterOption.Default, ProcessFlags Flags = ProcessFlags.Default, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize )
- roundRobinMapMany <S, T, U> ( ProcessName Name, int Count, Func<S> Setup, Func<S, U, S> Inbox, Func<T, IEnumerable<U>> MapMany, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" )
- roundRobinMapMany <T, U> ( ProcessName Name, IEnumerable<ProcessId> Workers, Func<T, IEnumerable<U>> MapMany, RouterOption Options = RouterOption.Default, ProcessFlags Flags = ProcessFlags.Default, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize )
- roundRobin <T> ( ProcessName Name, int Count, Action<T> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" )
- roundRobinMap <T, U> ( ProcessName Name, int Count, Action<U> Inbox, Func<T, U> Map, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" )
- roundRobinMapMany <T, U> ( ProcessName Name, int Count, Action<U> Inbox, Func<T, IEnumerable<U>> MapMany, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" )
- RouterOption
- Router
- fromConfig <T> (ProcessName name)
- fromConfig <T> (ProcessName name, Func<T, Unit> Inbox)
- fromConfig <T> (ProcessName name, Action<T> Inbox)
- fromConfig <S, T> (ProcessName name, Func<S> Setup, Func<S,T,S> Inbox)
- PersistenceType
- Schedule
- Due
- Key
- Type
- Fold
- Zero
- SetDue (DateTime due)
- SetKey (string key)
- MakeEphemeral ()
- MakePersistent ()
- Immediate = new Schedule(DateTime.MinValue, PersistenceType.Ephemeral, null, TakeLatest, default(object))
- Persistent (DateTime due)
- Ephemeral (DateTime due)
- Persistent (TimeSpan due)
- Ephemeral (TimeSpan due)
- Persistent (DateTime due, string key)
- Ephemeral (DateTime due, string key)
- Persistent (TimeSpan due, string key)
- Ephemeral (TimeSpan due, string key)
- PersistentAppend <MonoidA, A> (DateTime due, string key)
- EphemeralAppend <MonoidA, A> (DateTime due, string key)
- PersistentAppend <MonoidA, A> (TimeSpan due, string key)
- EphemeralAppend <MonoidA, A> (TimeSpan due, string key)
- PersistentFold <S, A> (DateTime due, string key, S state, Func<S, A, S> f)
- EphemeralFold <S, A> (DateTime due, string key, S state, Func<S, A, S> f)
- PersistentFold <S, A> (TimeSpan due, string key, S state, Func<S, A, S> f)
- EphemeralFold <S, A> (TimeSpan due, string key, S state, Func<S, A, S> f)
- SessionId
- Value
- SessionId (string value)
- Generate (int sizeInBytes = DefaultSessionIdSizeInBytes)
- IsValid
- ToString ()
- GetHashCode ()
- Equals (SessionId other)
- CompareTo (SessionId other)
- CompareTo (object obj)
- == (SessionId lhs, SessionId rhs)
- != (SessionId lhs, SessionId rhs)
- Equals (object obj)
- SupplementarySessionId
- Key = "sys-supp-session"
- Value
- SupplementarySessionId (string value)
- Generate (int sizeInBytes = DefaultSessionIdSizeInBytes)
- IsValid
- ToString ()
- GetHashCode ()
- New (string value)
- Equals (SupplementarySessionId other)
- CompareTo (SupplementarySessionId other)
- CompareTo (object obj)
- == (SupplementarySessionId lhs, SupplementarySessionId rhs)
- != (SupplementarySessionId lhs, SupplementarySessionId rhs)
- Equals (object obj)
- SystemName
- InvalidNameChars = MArray<char>.Inst.Append(System.IO.Path.GetInvalidFileNameChars(), new[] { '[', ']', ',' }).Distinct().ToArray()
- SystemName (string value)
- Value
- IsValid
- TryParse (string value)
- ToString ()
- GetHashCode ()
- Equals (SystemName other)
- CompareTo (SystemName other)
- CompareTo (object obj)
- == (SystemName lhs, SystemName rhs)
- != (SystemName lhs, SystemName rhs)
- Equals (object obj)
Sub sections
ActorSys |
Client |
Cluster |
Config |
Messages |
Session |
Strategy |
class AppProfile Source #
Application profile
It provides the core settings used when initialising the Process system. You don't create it yourself, it is passed to you once the config system has successfully parsed the config files.
field ProcessName NodeName Source #
The name of the running process system node Comes from the 'node-name' attribute in the configuration file.
field ProcessName Role Source #
The role of the running process system Comes from the 'role' attribute in the configuration file.
field string ClusterConn Source #
The cluster connection string Comes from the 'connection' attribute in the configuration file.
field string ClusterDb Source #
The cluster db name (in Redis this is "0"-"15"). Comes from the 'database' attribute in the configuration file.
field Option<SystemName> Env Source #
The environment name (this comes from the cluster variable name in the config file). Use this to build staging environments or to run multiple systems.
i.e cluster dev:
node-name: ms-1
role: mail-system
string sql-db: "dev.example.com"
..
cluster production:
node-name: ms-1
role: mail-system
string sql-db: "live.example.com"
class DeadLetter Source #
Dead letter message
property string ContentDisplay Source #
Summary of the message content
property string ContentTypeDisplay Source #
Friendly type display
method DeadLetter create (ProcessId sender, ProcessId recipient, Exception ex, string reason, object message) Source #
Create a new dead letter
method DeadLetter create (ProcessId sender, ProcessId recipient, string reason, object message) Source #
Create a new dead letter
method DeadLetter create (ProcessId sender, ProcessId recipient, Exception ex, object message) Source #
Create a new dead letter
method ProcessId register (ProcessName name, Func<ProcessId, IEnumerable<ProcessId>> selector) Source #
Registers a dispatcher for a role Dispatchers take in a 'leaf' ProcessId (i.e. /user/my-process) and return an enumerable of real ProcessIds that the Process system will use to deliver all of the standard functions like tell, ask, subscribe, etc.
param | name | Name of the dispatcher |
param | selector | Function that will be invoked every time a dispatcher based ProcessId is used. |
returns | A root dispatcher ProcessId. Use this to create new ProcessIds that will be passed to the selector function whenever the dispatcher based ProcessId is used |
method Unit deregister (ProcessName name) Source #
Removes the dispatcher registration for the named dispatcher
param | name | Name of the dispatcher to remove |
method ProcessId broadcast (IEnumerable<ProcessId> processIds) Source #
Builds a ProcessId that represents a set of Processes. When used for operations like 'tell', the message is dispatched to all Processes in the set.
tell( Dispatch.broadcast(pid1,pid2,pid3), "Hello" );
method ProcessId leastBusy (IEnumerable<ProcessId> processIds) Source #
Builds a ProcessId that represents a set of Processes. When used for operations like 'tell', the message is dispatched to the least busy Process from the set.
tell( Dispatch.leastBusy(pid1,pid2,pid3), "Hello" );
method ProcessId random (IEnumerable<ProcessId> processIds) Source #
Builds a ProcessId that represents a set of Processes. When used for operations like 'tell', the message is dispatched to a cryptographically random Process from the set.
tell( Dispatch.random(pid1,pid2,pid3), "Hello" );
method ProcessId roundRobin (IEnumerable<ProcessId> processIds) Source #
Builds a ProcessId that represents a set of Processes. When used for operations like 'tell', the message is dispatched to the Processes in a round-robin fashion
tell( Dispatch.roundRobin(pid1,pid2,pid3), "Hello" );
method ProcessId broadcast (ProcessId processId, params ProcessId[] processIds) Source #
Builds a ProcessId that represents a set of Processes. When used for operations like 'tell', the message is dispatched to all Processes in the set.
tell( Dispatch.broadcast(pid1,pid2,pid3), "Hello" );
method ProcessId leastBusy (ProcessId processId, params ProcessId[] processIds) Source #
Builds a ProcessId that represents a set of Processes. When used for operations like 'tell', the message is dispatched to the least busy Process from the set.
tell( Dispatch.leastBusy(pid1,pid2,pid3), "Hello" );
method ProcessId random (ProcessId processId, params ProcessId[] processIds) Source #
Builds a ProcessId that represents a set of Processes. When used for operations like 'tell', the message is dispatched to a cryptographically random Process from the set.
tell( Dispatch.random(pid1,pid2,pid3), "Hello" );
method ProcessId roundRobin (ProcessId processId, params ProcessId[] processIds) Source #
Builds a ProcessId that represents a set of Processes. When used for operations like 'tell', the message is dispatched to the Processes in a round-robin fashion
tell( Dispatch.roundRobin(pid1,pid2,pid3), "Hello" );
method Option<Func<ProcessId, IEnumerable<ProcessId>>> getFuncOption (ProcessName name) Source #
interface HasEcho <RT> Source #
Placeholder Echo trait
type | RT | Runtime |
class NamedProcessAlreadyExistsException Source #
Named process already exists
constructor NamedProcessAlreadyExistsException () Source #
Ctor
constructor NamedProcessAlreadyExistsException (string message) Source #
Ctor
constructor NamedProcessAlreadyExistsException (string message, Exception innerException) Source #
Ctor
class InvalidSystemNameException Source #
Invalid SystemName
constructor InvalidSystemNameException () Source #
Ctor
constructor InvalidSystemNameException (string message) Source #
Ctor
constructor InvalidSystemNameException (string message, Exception innerException) Source #
Ctor
class InvalidProcessNameException Source #
Invalid process name
constructor InvalidProcessNameException () Source #
Ctor
constructor InvalidProcessNameException (string message) Source #
Ctor
constructor InvalidProcessNameException (string message, Exception innerException) Source #
Ctor
class InvalidProcessIdException Source #
Invalid process ID
constructor InvalidProcessIdException () Source #
Ctor
constructor InvalidProcessIdException (string message) Source #
Ctor
constructor InvalidProcessIdException (string message, Exception innerException) Source #
Ctor
class NoChildProcessesException Source #
NoChildProcessesException
constructor NoChildProcessesException () Source #
Ctor
constructor NoChildProcessesException (string message) Source #
Ctor
constructor NoChildProcessesException (string message, Exception innerException) Source #
Ctor
class AskException Source #
The message can't be asked
constructor AskException (string message) Source #
class ProcessException Source #
A process threw an exception in its message loop
constructor ProcessException (string message, string self, string sender, Exception innerException) Source #
Ctor
constructor ProcessException (string message, string self, string sender) Source #
Ctor
class ProcessSetupException Source #
A process threw an exception in its setup function
constructor ProcessSetupException (string self, Exception innerException) Source #
Ctor
class ProcessKillException Source #
Kill process
constructor ProcessKillException () Source #
Ctor
constructor ProcessKillException (string message) Source #
Ctor
constructor ProcessKillException (string message, Exception innerException) Source #
Ctor
class ProcessInboxFullException Source #
Process inbox is full
constructor ProcessInboxFullException (ProcessId pid, int maximumSize, string type) Source #
Ctor
class ProcessSessionExpired Source #
Session expired
constructor ProcessSessionExpired () Source #
Ctor
class NoRouterWorkersException Source #
There are no children to route the message to
constructor NoRouterWorkersException () Source #
Ctor
class ProcessConfigException Source #
constructor ProcessConfigException () Source #
constructor ProcessConfigException (string message) Source #
constructor ProcessConfigException (string message, Exception innerException) Source #
class QueueFullException Source #
constructor QueueFullException () Source #
constructor QueueFullException (string message) Source #
constructor QueueFullException (string message, Exception innerException) Source #
class ClientDisconnectedException Source #
constructor ClientDisconnectedException (ClientConnectionId id) Source #
constructor ClientDisconnectedException (ClientConnectionId id, string message) Source #
constructor ClientDisconnectedException (ClientConnectionId id, string message, Exception innerException) Source #
class ProcessSystemException Source #
interface IProcess <in T> Source #
Represents a process as an object rather than a function
type | T | Message type |
class JsonBinder Source #
Attempts to deal with the issue of serialising between .NET Framework and .NET Core The core libraries of each framework have different names, and the serialised types have these names embedded. This binder attempts to use the assembly and type-name provided. If it fails then it calls Type.GetType which has the following documented behaviour:
"If the type is in the currently executing assembly or in mscorlib.dll/System.Private.CoreLib.dll, it is sufficient to supply the type name qualified by its namespace"
https://docs.microsoft.com/en-us/dotnet/api/system.type.gettype?view=net-5.0
It also looks for the TypeForwardedFrom attribute which is used to indicate a type moved from one assembly to another in the past. So this acts like a redirect. We can send both assembly-names with the messages so we can try both when deserialising.
method Type BindToType (string asm, string tyname) Source #
Takes an assembly-name and type-name and tries to get the concrete Type
This can handle multiple assembly names and will try them all. If it fails then it will do a last gasp attempt at loading via the Type.GetType function (which doesn't need an assembly name in all circumstances)
method void BindToName (Type serializedType, out string assemblyName, out string typeName) Source #
Takes a known type and extracts an-assembly name and type-name from it
This checks for a TypeForwardedFrom attribute, which is what library writers use to indicate that the type used to exist in another assembly with a different name. If this is the case then we return both assembly names with a '|' separator. This means that the deserialiser can try both assembly names.
Process: Ask functions
'ask' is a request/response system for processes. You can ask a process a question (a message) and it
can reply using the 'Process.reply' function. It doesn't have to and 'ask' will timeout after
ActorConfig.Default.Timeout seconds.
'ask' is blocking, because mostly it will be called from within a process and processes shouldn't
perform asynchronous operations.
method T ask <T> (ProcessId pid, object message, ProcessId sender) Source #
Ask a process for a reply
param | pid | Process to ask |
param | message | Message to send |
param | sender | Sender process |
returns | The response to the request |
method T ask <T> (ProcessId pid, object message) Source #
Ask a process for a reply
param | pid | Process to ask |
param | message | Message to send |
returns | The response to the request |
method Task<R> askAsync <R> (ProcessId pid, object message, ProcessId sender) Source #
Asynchronous ask - must be used outside of a Process
type | R | Type of the return value |
param | pid | Process to ask |
param | message | Message to send |
param | sender | Sender process |
returns | A promise to return a response to the request |
method Option<T> askIfAlive <T> (ProcessId pid, object message, ProcessId sender) Source #
Ask a process for a reply (if the process is running). If the process isn't running then None is returned
param | pid | Process to ask |
param | message | Message to send |
param | sender | Sender process |
returns | The response to the request or None if the process isn't running |
method Option<T> askIfAlive <T> (ProcessId pid, object message) Source #
Ask a process for a reply (if the process is running). If the process isn't running then None is returned
param | pid | Process to ask |
param | message | Message to send |
returns | The response to the request or None if the process isn't running |
method Task<R> askAsync <R> (ProcessId pid, object message) Source #
Asynchronous ask - must be used outside of a Process
type | R | Type of the return value |
param | pid | Process to ask |
param | message | Message to send |
returns | A promise to return a response to the request |
method IEnumerable<T> askChildren <T> (object message, int take = Int32.MaxValue) Source #
Ask children the same message
param | message | Message to send |
returns |
method T askParent <T> (object message) Source #
Ask parent process for a reply
param | message | Message to send |
returns | The response to the request |
method T askChild <T> (ProcessName name, object message) Source #
Ask a named child process for a reply
param | message | Message to send |
param | name | Name of the child process |
method T askChild <T> (int index, object message) Source #
Ask a child process (found by index) for a reply
Because of the potential changeable nature of child nodes, this will take the index and mod it by the number of children. We expect this call will mostly be used for load balancing, and round-robin type behaviour, so feel that's acceptable.
param | message | Message to send |
param | index | Index of the child process (see remarks) |
class ProcessConfig Source #
method Unit initialiseWeb (IEnumerable<FuncSpec> strategyFuncs = null) Source #
Process system configuration initialisation This will look for cluster.conf and process.conf files in the web application folder, you should call this function from within Application_BeginRequest of Global.asax. It can run multiple times, once the config has loaded the system won't re-load the config until you call ProcessConfig.unload() by ProcessConfig.initialiseWeb(...)
param | strategyFuncs | Plugin extra strategy behaviours by passing in a list of FuncSpecs. |
method Unit initialiseWeb (Action setup, IEnumerable<FuncSpec> strategyFuncs = null) Source #
Process system configuration initialisation This will look for cluster.conf and process.conf files in the web application folder, you should call this function from within Application_BeginRequest of Global.asax. It can run multiple times, once the config has loaded the system won't re-load the config until you call ProcessConfig.unload() followed by ProcessConfig.initialiseWeb(...)
NOTE: If a cluster is specified in the cluster.conf and its 'node-name' matches the host name of the web- application (i.e. www.example.com), then those settings will be used to connect to the cluster. This allows for different staging environments to be setup.
param | setup | A setup function to call on successful loading of the configuration files - this will happen once only. |
param | strategyFuncs | Plugin extra strategy behaviours by passing in a list of FuncSpecs. |
method Unit initialiseWeb (string nodeName, IEnumerable<FuncSpec> strategyFuncs = null) Source #
Process system configuration initialisation
This will look for cluster.conf
and process.conf
files in the web application folder, you should call this
function from within Application_BeginRequest
of Global.asax
or in the Configuration
function of an OWIN
Startup
type.
param | nodeName |
Web-site host-name: i.e.
|
param | strategyFuncs | Plugin extra strategy behaviours by passing in a list of FuncSpecs. |
method Unit initialiseWeb (string nodeName, Action setup, IEnumerable<FuncSpec> strategyFuncs = null, string appPath = null) Source #
param | nodeName |
Web-site host-name: i.e.
|
param | setup | A setup function to call on successful loading of the configuration files - this will happen once only.
|
param | strategyFuncs | Plugin extra strategy behaviours by passing in a list of FuncSpecs. |
method Unit initialiseFileSystem (string nodeName, IEnumerable<FuncSpec> strategyFuncs = null) Source #
Process system configuration initialisation This will look for cluster.conf and process.conf files in the application folder. It can run multiple times, once the config has loaded the system won't re-load the config until you call ProcessConfig.unload() followed by ProcessConfig.initialiseFileSystem(...), so it's safe to not surround it with ifs.
NOTE: If a cluster is specified in the cluster.conf and its 'node-name' matches nodeName, then those settings will be used to connect to the cluster. This allows for different staging environments to be setup.
param | nodeName | If a cluster is specified in the cluster.conf and its 'node-name' matches nodeName, then those settings will be used to connect to the cluster. This allows for different staging environments to be setup. |
param | strategyFuncs | Plugin extra strategy behaviours by passing in a list of FuncSpecs. |
method Unit initialiseFileSystem (Action setup, IEnumerable<FuncSpec> strategyFuncs = null) Source #
Process system configuration initialisation This will look for process.conf files in the application folder. It can run multiple times, once the config has loaded the system won't re-load the config until you call ProcessConfig.unload() followed by ProcessConfig.initialiseFileSystem(...), so it's safe to not surround it with ifs.
param | setup | A setup function to call on successful loading of the configuration files - this will happen once only. |
param | strategyFuncs | Plugin extra strategy behaviours by passing in a list of FuncSpecs. |
method Unit initialiseFileSystem (IEnumerable<FuncSpec> strategyFuncs = null) Source #
Process system configuration initialisation This will look for process.conf files in the application folder. It can run multiple times, once the config has loaded the system won't re-load the config until you call ProcessConfig.unload() followed by ProcessConfig.initialiseFileSystem(...), so it's safe to not surround it with ifs.
param | strategyFuncs | Plugin extra strategy behaviours by passing in a list of FuncSpecs. |
method Unit initialiseFileSystem (string nodeName, Action setup, IEnumerable<FuncSpec> strategyFuncs = null, string appPath = null) Source #
Process system configuration initialisation This will look for cluster.conf and process.conf files in the application folder. It can run multiple times, but once the config has loaded the system won't re-load the config until you call ProcessConfig.unload() followed by ProcessConfig.initialiseFileSystem(...), so it's safe to not surround it with ifs.
NOTE: If a cluster is specified in the cluster.conf and its 'node-name' matches nodeName, then those settings will be used to connect to the cluster. This allows for different staging environments to be setup.
param | nodeName | If a cluster is specified in the cluster.conf and its 'node-name' matches nodeName, then those settings will be used to connect to the cluster. This allows for different staging environments to be setup. |
param | setup | A setup function to call on successful loading of the configuration files - this will happen once only. |
param | strategyFuncs | Plugin extra strategy behaviours by passing in a list of FuncSpecs. |
method Unit initialise () Source #
Process system initialisation Initialises am in-memory only Process system
method Unit initialise ( SystemName systemName, ProcessName roleName, ProcessName nodeName, string connectionString, string catalogueName, string providerName = "redis" ) Source #
Initialise without a config file or text
param | systemName | Name of the system - this is most useful |
param | roleName | |
param | nodeName | |
param | providerName | |
param | connectionString | |
param | catalogueName | |
returns |
method Unit initialise (string configText, Option<string> nodeName, Action setup = null, IEnumerable<FuncSpec> strategyFuncs = null) Source #
Process system configuration initialisation This will parse the configuration text, It can run multiple times, once the config has loaded the system won't re-load the config until you call ProcessConfig.unload() followed by ProcessConfig.initialise(...), so it's safe to not surround it with ifs.
NOTE: If a cluster is specified in config text and its 'node-name' matches nodeName, then those settings will be used to connect to the cluster. This allows for different staging environments to be setup.
param | nodeName | If a cluster is specified in the cluster.conf and its 'node-name' matches nodeName, then those settings will be used to connect to the cluster. This allows for different staging environments to be setup. |
param | setup | A setup function to call on successful loading of the configuration files - this will happen once only. |
param | strategyFuncs | Plugin extra strategy behaviours by passing in a list of FuncSpecs. |
method T read <T> (string name, string prop, T defaultValue, SystemName system = default(SystemName)) Source #
Access a setting If in a Process message loop, then this accesses the configuration settings for the Process from the the configuration file, or stored in the cluster. If not in a Process message loop, then this accesses 'global' configuration settings.
param | name | Name of the setting |
param | prop | If the setting is a complex value (like a map or record), then this selects the property of the setting to access |
returns | Optional configuration setting value |
method T read <T> (string name, T defaultValue) Source #
Access a setting If in a Process message loop, then this accesses the configuration settings for the Process from the the configuration file, or stored in the cluster. If not in a Process message loop, then this accesses 'global' configuration settings.
param | name | Name of the setting |
param | prop | If the setting is a complex value (like a map or record), then this selects the property of the setting to access |
returns | Optional configuration setting value |
method Lst<T> readList <T> (string name, string prop = "value") Source #
Access a list setting If in a Process message loop, then this accesses the configuration settings for the Process from the the configuration file, or stored in the cluster. If not in a Process message loop, then this accesses 'global' configuration settings.
param | name | Name of the setting |
param | prop | If the setting is a complex value (like a map or record), then this selects the property of the setting to access |
returns | Optional configuration setting value |
method HashMap<string, T> readMap <T> (string name, string prop = "value") Source #
Access a map setting If in a Process message loop, then this accesses the configuration settings for the Process from the the configuration file, or stored in the cluster. If not in a Process message loop, then this accesses 'global' configuration settings.
param | name | Name of the setting |
param | prop | If the setting is a complex value (like a map or record), then this selects the property of the setting to access |
returns | Optional configuration setting value |
method Unit write (string name, object value) Source #
Write a setting
param | name | Name of the setting |
param | value | Value to set |
method Unit write (string name, string prop, object value, SystemName system = default(SystemName)) Source #
Write a setting
param | name | Name of the setting |
param | prop | If the setting is a complex value (like a map or record), then this selects the property of the setting to access |
param | value | Value to set |
method Unit dead (object message, string reason, SystemName system = default(SystemName)) Source #
Forward a message to dead-letters (and wrap it in a contextual dead-letter structre)
param | message | Dead letter message |
param | reason | Reason for the dead-letter |
method Unit dead (object message, Exception ex, SystemName system = default(SystemName)) Source #
Forward a message to dead-letters (and wrap it in a contextual dead-letter structre)
param | message | Dead letter message |
param | ex | Exception that caused the dead-letter |
method Unit dead (object message, Exception ex, string reason, SystemName system = default(SystemName)) Source #
Forward a message to dead-letters (and wrap it in a contextual dead-letter structre)
param | message | Dead letter message |
param | ex | Exception that caused the dead-letter |
param | reason | Reason for the dead-letter |
method Unit dead (string reason, SystemName system = default(SystemName)) Source #
Forward the current message to dead-letters (and wrap it in a contextual dead-letter structre)
param | reason | Reason for the dead-letter |
Process: Forward functions
'fwd' is used to forward a message onto another process whilst maintaining the original
sender context (for 'ask' responses to go back to the right place).
method Unit fwd <T> (ProcessId pid, T message) Source #
Forward a message
param | pid | Process ID to send to |
param | message | Message to send |
method Unit fwdChild <T> (ProcessName name, T message) Source #
Forward a message to a named child process
param | message | Message to send |
param | name | Name of the child process |
method Unit fwdChild <T> (int index, T message) Source #
Forward a message to a child process (found by index)
Because of the potential changeable nature of child nodes, this will take the index and mod it by the number of children. We expect this call will mostly be used for load balancing, and round-robin type behaviour, so feel that's acceptable.
param | message | Message to send |
param | index | Index of the child process (see remarks) |
method Unit fwdChild (ProcessName name) Source #
Forward a message to a named child process
param | name | Name of the child process |
method Unit fwdChild (int index) Source #
Forward a message to a child process (found by index)
Because of the potential changeable nature of child nodes, this will take the index and mod it by the number of children. We expect this call will mostly be used for load balancing, and round-robin type behaviour, so feel that's acceptable.
param | index | Index of the child process (see remarks) |
method Option<ICluster> SystemCluster (SystemName system = default(SystemName)) Source #
Not advised to use this directly, but allows access to the underlying data-store.
method ProcessId resolvePID (ProcessId pid) Source #
method void logUserErr (string message) Source #
Log user error - Internal
method ProcessId spawnRoundRobin <T> ( ProcessName Name, int Count, Action<T> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize ) Source #
Spawns a new process with N worker processes, each message is sent to one worker process in a round robin fashion.
type | T | Message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
param | MaxMailboxSize | Maximum inbox size |
returns | Process ID of the delegator process |
method ProcessId spawnRoundRobin <S, T> ( ProcessName Name, int Count, Func<S> Setup, Func<S, T, S> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize ) Source #
Spawns a new process with N worker processes, each message is sent to one worker process in a round robin fashion.
type | S | State type |
type | T | Message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
param | MaxMailboxSize | Maximum inbox size |
returns | Process ID of the delegator process |
method Unit publish <T> (T message) Source #
Publish a message for any listening subscribers
This should be used from within a process' message loop only
param | message | Message to publish |
method IDisposable publish <T> (T message, TimeSpan delayFor) Source #
Publish a message for any listening subscribers, delayed.
This should be used from within a process' message loop only
param | message | Message to publish |
param | delayFor | How long to delay sending for |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
method IDisposable publish <T> (T message, DateTime delayUntil) Source #
Publish a message for any listening subscribers, delayed.
This should be used from within a process' message loop only This will fail to be accurate across a Daylight Saving Time boundary
param | message | Message to publish |
param | delayUntil | When to send |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
method Unit subscribe (ProcessId pid) Source #
Subscribes our inbox to another process publish stream. When it calls 'publish' it will arrive in our inbox.
This should be used from within a process' message loop only
param | pid | Process to subscribe to |
returns | IDisposable, call IDispose to end the subscription |
method Unit unsubscribe (ProcessId pid) Source #
Unsubscribe from a process's publications
param | pid | Process to unsub from |
method IDisposable subscribe <T> (ProcessId pid, IObserver<T> observer) Source #
Subscribe to the process publish stream. When a process calls 'publish' it emits messages that can be consumed using this method.
The process can publish any number of types, any published messages not of type T will be ignored.
Because this call is asychronous it could allow access to the message loop, therefore you can't call it from within a process message loop.
returns | IDisposable, call IDispose to end the subscription |
method IDisposable subscribe <T> (ProcessId pid, Action<T> onNext, Action<Exception> onError, Action onComplete) Source #
Subscribe to the process publish stream. When a process calls 'publish' it emits messages that can be consumed using this method.
The process can publish any number of types, any published messages not of type T will be ignored.
Because this call is asychronous it could allow access to the message loop, therefore you can't call it from within a process message loop.
returns | IDisposable, call IDispose to end the subscription |
method IDisposable subscribe <T> (ProcessId pid, Action<T> onNext, Action<Exception> onError) Source #
Subscribe to the process publish stream. When a process calls 'publish' it emits messages that can be consumed using this method.
The process can publish any number of types, any published messages not of type T will be ignored.
Because this call is asychronous it could allow access to the message loop, therefore you can't call it from within a process message loop.
method IDisposable subscribe <T> (ProcessId pid, Action<T> onNext) Source #
Subscribe to the process publish stream. When a process calls 'publish' it emits messages that can be consumed using this method.
The process can publish any number of types, any published messages not of type T will be ignored.
Because this call is asychronous it could allow access to the message loop, therefore you can't call it from within a process message loop.
method IDisposable subscribe <T> (ProcessId pid, Action<T> onNext, Action onComplete) Source #
Subscribe to the process publish stream. When a process calls 'publish' it emits messages that can be consumed using this method.
The process can publish any number of types, any published messages not of type T will be ignored.
Because this call is asychronous it could allow access to the message loop, therefore you can't call it from within a process message loop.
returns | IDisposable, call IDispose to end the subscription |
method IObservable<T> observe <T> (ProcessId pid) Source #
Get an IObservable for a process publish stream. When a process calls 'publish' it emits messages on the observable returned by this method.
The process can publish any number of types, any published messages not of type T will be ignored.
Because this call is asychronous it could allow access to the message loop, therefore you can't call it from within a process message loop.
returns | IObservable T |
method IObservable<T> observeUnsafe <T> (ProcessId pid) Source #
Get an IObservable for a process publish stream. When a process calls 'publish' it emits messages on the observable returned by this method.
The process can publish any number of types, any published messages not of type T will be ignored.
Because this call is asychronous it could allow access to the message loop, that's why this
function is labelled Unsafe
. Careful disposing and capture of free variables is required to not
break the principles of actors.
returns | IObservable T |
method IObservable<T> observeState <T> (ProcessId pid) Source #
Get an IObservable for a process's state stream. When a process state updates at the end of its message loop it announces it on the stream returned from this method. You should use this for notification only. Never modify the state object belonging to a process. Best practice is to make the state type immutable.
The process can publish any number of types, any published messages not of type T will be ignored.
Because this call is asychronous it could allow access to the message loop, therefore you can't call it from within a process message loop.
returns | IObservable T |
method IObservable<T> observeStateUnsafe <T> (ProcessId pid) Source #
Get an IObservable for a process's state stream. When a process state updates at the end of its message loop it announces it on the stream returned from this method. You should use this for notification only. Never modify the state object belonging to a process. Best practice is to make the state type immutable.
The process can publish any number of types, any published messages not of type T will be ignored.
Because this call is asychronous it could allow access to the message loop, that's why this
function is labelled Unsafe
. Careful disposing and capture of free variables is required to not
break the principles of actors.
returns | IObservable T |
method Unit subscribeState <T> (ProcessId pid) Source #
Subscribes our inbox to another process state publish stream. When a process state updates at the end of its message loop it announces it arrives in our inbox. You should use this for notification only. Never modify the state object belonging to a process. Best practice is to make the state type immutable.
The process can publish any number of types, any published messages not of type T will be ignored. This should be used from within a process' message loop only
returns |
method IEnumerable<ProcessName> queryRegistered (ProcessName role, string keyQuery, SystemName system = default(SystemName)) Source #
Finds all persistent registered names in a role
param | role | Role to limit search to |
param | keyQuery | Key query. * is a wildcard |
returns | Registered names |
method IEnumerable<ProcessId> queryProcesses (string keyQuery, SystemName system = default(SystemName)) Source #
Finds all persistent processes based on the search pattern provided. Note the returned ProcessIds may contain processes that aren't currently active. You can still post to them however.
param | keyQuery | Key query. * is a wildcard |
returns | Matching ProcessIds |
method HashMap<ProcessId, ProcessMetaData> queryProcessMetaData (string keyQuery, SystemName system = default(SystemName)) Source #
Finds all persistent processes based on the search pattern provided and then returns the meta-data associated with them.
param | keyQuery | Key query. * is a wildcard |
returns | Map of ProcessId to ProcessMetaData |
Process registration - 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.
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("regd-name", 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");
method ProcessId find (ProcessName name) Source #
Find a process by its registered name (a kind of DNS for Processes).
Names are registered in roles. This function will find registered processes in the current role only. Use the 'find' variant to find registered processes in other roles.
See 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");
param | name | Process name |
returns | A ProcessId that allows dispatching to the process(es). The result would look like /disp/reg/name |
method ProcessId find (ProcessName role, ProcessName name) Source #
Find a process by its registered name (a kind of DNS for Processes) in the role specified.
See 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");
param | role | Process role |
param | name | Process name |
returns | A ProcessId that allows dispatching to the process(es). The result would look like /disp/reg/name |
method ProcessId register (ProcessName name, SystemName system = default(SystemName)) Source #
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.
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
param | name | Name to register under |
returns | A ProcessId that allows dispatching to the process via the name. The result would look like /disp/reg/name |
method ProcessId register (ProcessName name, ProcessId process) Source #
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.
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");
param | name | Name to register under |
param | process | Process to be registered |
returns | A ProcessId that allows dispatching to the process(es). The result would look like /disp/reg/name |
method Unit deregisterById (ProcessId process) Source #
Deregister a Process from any names it's been registered as.
See remarks.
Any Process (or dispatcher, or role, etc.) can be registered by a name - a kind of DNS for ProcessIds. There can be multiple names associated with a single ProcessId.
This function removes all registered names for a specific ProcessId. If you wish to deregister all ProcessIds registered under a name then use Process.deregisterByName(name)
param | process | Process to be deregistered |
method Unit deregisterByName (ProcessName name, SystemName system = default(SystemName)) Source #
Deregister all Processes associated with a name. NOTE: Be very careful with usage of this function if you didn't handle the registration you are potentially disconnecting many Processes from their registered name.
See remarks.
Any Process (or dispatcher, or role, etc.) can be registered by a name - a kind of DNS for ProcessIds. There can be multiple names associated with a single ProcessId and multiple ProcessIds associated with a name.
This function removes all registered ProcessIds for a specific name. If you wish to deregister all names registered for specific Process then use Process.deregisterById(pid)
param | name | Name of the process to deregister |
Process: Reply functions
The reply functions are used to send responses back to processes that have sent
a message using 'ask'. The replyError variants are for bespoke error handling
but if you let the process throw an exception when something goes wrong, the
Process system will auto-reply with an error response (and throw it for the
process that's asking). If the asking process doesn't capture the error then
it will continue to cascade to the original asking process.
field NoReturn noreply = NoReturn.Default Source #
Use this to cancel a reply in the proxy system
method Unit reply <T> (T message) Source #
Reply to an ask
This should be used from within a process' message loop only
method Unit replyIfAsked <T> (T message) Source #
Reply if asked
This should be used from within a process' message loop only
method Unit replyError (Exception exception) Source #
Reply to an ask with an error
This should be used from within a process' message loop only
method Unit replyError (string errorMessage) Source #
Reply to an ask with an error
This should be used from within a process' message loop only
method Unit replyErrorIfAsked (Exception exception) Source #
Reply with an error if asked
This should be used from within a process' message loop only
method Unit replyErrorIfAsked (string errorMessage) Source #
Reply with an error if asked
This should be used from within a process' message loop only
method Unit replyOrTellSender <T> (T message) Source #
Reply to the asker, or if it's not an ask then tell the sender via a message to their inbox.
Process: Session functions
These functions facilitate the use of sessions that live from
Process to Process. Essentially if there's an active Session
ID then it will be packaged with each message that is sent via
tell or ask.
field IObservable<SessionId> SessionEnded = sessionEnded Source #
field IObservable<SessionId> SessionStarted = sessionStarted Source #
method SessionId sessionStart (SessionId sid, Time timeout, SystemName system) Source #
Starts a new session in the Process system with the specified session ID
param | sid | Session ID |
param | timeout | Session timeout |
method SessionId sessionStart (SessionId sid, Time timeout) Source #
Starts a new session in the Process system. This variant must be called from within a Process, use the variant where you specify the SystemName to use it from outside
param | timeout | Session timeout |
returns | sid |
method SessionId sessionStart (Time timeout) Source #
Starts a new session in the Process system. This variant must be called from within a Process, use the variant where you specify the SystemName to use it from outside
param | timeout | Session timeout |
returns | Session ID of the newly created session |
method Unit sessionStop () Source #
Ends a session in the Process system with the specified session ID
param | sid | Session ID |
method Unit sessionTouch () Source #
Touch a session Time-stamps the session so that its time-to-expiry is reset
method Unit sessionTouch (SessionId sid) Source #
Touch a session Time-stamps the session so that its time-to-expiry is reset and also sets the current session ID. This should be used from inside of the Process system to 'acquire' an existing session. This is useful for web-requests for example to set the current session ID and to indicate activity.
param | sid | Session ID |
method Unit setSession (SessionId sid) Source #
Sets the current session to the provided sessionid
param | sid | |
returns |
method Option<SessionId> sessionId () Source #
Gets the current session ID
Also touches the session so that its time-to-expiry is reset
returns | Optional session ID |
method Unit sessionSetData (string key, object value) Source #
Set the meta-data to store with the current session, this is typically user credentials when they've logged in. But can be anything. It is a key/value store that is sync'd around the cluster.
param | key | Key |
param | value | Data value |
method Unit sessionClearData (string key) Source #
Clear the meta-data key stored with the session
param | sid | Session ID |
param | key | Key |
method Seq<T> sessionGetData <T> (string key) Source #
Get the meta-data stored with the session.
The session system allows concurrent updates from across the cluster or from within the app-domain (from multiple processes). To maintain the integrity of the data in any one session, the system uses a version clock per-key.
That means that if two Processes update the session from the same 'time' start point, then there will be a conflict and the session will contain both values stored against the key.
It is up to you to decide on the best approach to resolving the conflict. Calling Head() / HeadOrNone() on the result will get the value that was written first, calling Last() will get the value that was written last. However, being first or last doesn't necessarily make a value 'right', in an asynchronous system the last value could be the newest or oldest. Both value commits had the same starting state, so if the consistency of the session data is important to you then you should implement a more robust strategy to deal with value conflicts, if integrity doesn't really matter, call HeadOrNone().
The versioning system is closest to Lamport Clocks. Eventually this implementation will be replaced with a Dotted Version Vector system.
param | key | Key |
method bool hasSession () Source #
Returns True if there is a session ID available. NOTE: That doesn't mean the session is still alive.
returns |
method R withSession <R> (SessionId sid, Func<R> f) Source #
Acquires a session for the duration of invocation of the provided function. NOTE: This does not create a session, or check that a session exists.
param | sid | Session ID |
param | f | Function to invoke |
returns | Result of the function |
method Unit withSession (SessionId sid, Action f) Source #
Acquires a session ID for the duration of invocation of the provided action. NOTE: This does not create a session, or check that a session exists.
param | sid | Session ID |
param | f | Action to invoke |
method bool hasActiveSession () Source #
Returns true if the current session is active, returns false if not in message loop or session is not active.
returns |
method Unit addSupplementarySession (SupplementarySessionId sid) Source #
Adds a supplementary session id to existing session. If the current session already has a supplmentary session replace it
param | sid | |
returns |
method Option<SessionId> getSessionBySupplementaryId (SupplementarySessionId sid) Source #
Gets a echo session id which contains a supplementary session
param | sid | |
returns |
method Option<SupplementarySessionId> getSupplementarySessionId () Source #
Get supplementary session id for current session
returns |
method SupplementarySessionId provideSupplementarySessionId () Source #
Get supplementary session id for current session. If not exists, create a new one.
returns |
Process: Spawn functions
The spawn functions create a new process. Processes are either simple message receivers that
don't manage state and therefore only need a messageHandler. Or they manage state over time.
If they manage state then you should also provide a 'setup' function that generates the initial
state. This allows the process system to recover if a process crashes. It can re-call the
setup function to reset the state and continue processing the messages.
method ProcessId spawn <T> ( ProcessName Name, Action<T> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, Action<ProcessId> Terminated = null ) Source #
Create a new process by name. If this is called from within a process' message loop then the new process will be a child of the current process. If it is called from outside of a process, then it will be made a child of the root 'user' process.
type | T | Type of messages that the child-process can accept |
param | Name | Name of the child-process |
param | Inbox | Function that is the process |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
param | Terminated | Message function to call when a Process [that this Process watches] terminates |
returns | A ProcessId that identifies the child |
method ProcessId spawnUnit <T> ( ProcessName Name, Func<T, Unit> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, Func<ProcessId, Unit> Terminated = null ) Source #
Create a new process by name (accepts Unit as a return value instead of void). If this is called from within a process' message loop then the new process will be a child of the current process. If it is called from outside of a process, then it will be made a child of the root 'user' process.
type | T | Type of messages that the child-process can accept |
param | Name | Name of the child-process |
param | Inbox | Function that is the process |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
param | Terminated | Message function to call when a Process [that this Process watches] terminates |
returns | A ProcessId that identifies the child |
method ProcessId spawn <S, T> ( ProcessName Name, Func<S> Setup, Func<S, T, S> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, Func<S, ProcessId, S> Terminated = null, Func<S, Unit> Shutdown = null, SystemName System = default(SystemName), bool Lazy = false ) Source #
Create a new process by name. If this is called from within a process' message loop then the new process will be a child of the current process. If it is called from outside of a process, then it will be made a child of the root 'user' process.
type | T | Type of messages that the child-process can accept |
param | Name | Name of the child-process |
param | Setup | Startup and restart function |
param | Inbox | Function that is the process |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
param | Terminated | Message function to call when a Process [that this Process watches] terminates |
param | Lazy | If set to true actor will not start automatically, you need to startup(processId) manually |
returns | A ProcessId that identifies the child |
method IEnumerable<ProcessId> spawnMany <T> ( int Count, ProcessName Name, Action<T> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, Action<ProcessId> Terminated = null ) Source #
Create N child processes. The name provided will be used as a basis to generate the child names. Each child will be named "name-index" where index starts at zero. If this is called from within a process' message loop then the new processes will be a children of the current process. If it is called from outside of a process, then they will be made a child of the root 'user' process.
type | T | Type of messages that the child-process can accept |
param | Count | Number of processes to spawn |
param | Name | Name of the child-process |
param | Inbox | Function that is the process |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
param | MaxMailboxSize | Maximum inbox size |
param | Terminated | Message function to call when a Process [that this Process watches] terminates |
returns | ProcessId IEnumerable |
method IEnumerable<ProcessId> spawnMany <S, T> ( int Count, ProcessName Name, Func<S> Setup, Func<S, T, S> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, Func<S, Unit> Shutdown = null, Func<S, ProcessId, S> Terminated = null ) Source #
Create N child processes. The name provided will be used as a basis to generate the child names. Each child will be named "name-index" where index starts at zero. If this is called from within a process' message loop then the new processes will be a children of the current process. If it is called from outside of a process, then they will be made a child of the root 'user' process.
type | T | Type of messages that the child-process can accept |
param | Count | Number of processes to spawn |
param | Setup | Startup and restart function |
param | Name | Name of the child-process |
param | Inbox | Function that is the process |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
param | MaxMailboxSize | Maximum inbox size |
param | Terminated | Message function to call when a Process [that this Process watches] terminates |
returns | ProcessId IEnumerable |
method IEnumerable<ProcessId> spawnMany <S, T> ( ProcessName Name, HashMap<int, Func<S>> Spec, Func<S, T, S> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, Func<S, Unit> Shutdown = null, Func<S, ProcessId, S> Terminated = null ) Source #
Create N child processes. The name provided will be used as a basis to generate the child names. Each child will be named "name-index" where index starts at zero. If this is called from within a process' message loop then the new processes will be a children of the current process. If it is called from outside of a process, then they will be made a child of the root 'user' process.
type | S | State type |
type | T | Type of messages that the child-process can accept |
param | Spec | Map of IDs and State for generating child workers |
param | Name | Name of the child-process |
param | Inbox | Function that is the process |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
param | MaxMailboxSize | Maximum inbox size |
param | Terminated | Message function to call when a Process [that this Process watches] terminates |
returns | ProcessId IEnumerable |
method ProcessId spawn <TProcess,TMsg> ( ProcessName Name, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize ) Source #
Spawn by type
type | TProcess | Process type |
type | TMsg | Message type |
param | Name | Name of process to spawn |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
param | MaxMailboxSize | Maximum inbox size |
returns | ProcessId |
method TProcess proxy <TProcess> (ProcessId pid) Source #
Proxy based system for processes that are defined by a single type: their state type. The state type holds state in its member variables and its message handlers are its member functions. This function builds a proxy from the interface passed so that you can invoke the message- handlers in a strongly typed way.
type | TProcess | Interface type that represents the Process |
param | pid | ProcessId of the Process to proxy |
returns | An interface that automatically tells and asks depending on method arguments and return types. |
method TProcessInterface spawn <TProcessInterface> ( ProcessName Name, Func<TProcessInterface> Setup, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize ) Source #
Spawn by iterface type. You must provide a Setup function that returns the concrete implementation of TProcessInterface. Communication is via a generated proxy: the returned TProcessInterface.
type | TProcess | Process type |
param | Name | Name of process to spawn |
param | Setup | You must provide a Setup function that returns the concrete implementation of TProcessInterface |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
param | MaxMailboxSize | Maximum inbox size |
returns | TProcessInterface - The proxy for communicating with the Process |
method ProcessId spawn <TProcess> ( ProcessName Name, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize ) Source #
Spawn by type. Communication is via proxy - call Process.proxy(pid) on the resulting ProcessId to send tells and asks in a strongly typed fashion.
type | TProcess | Process type |
param | Name | Name of process to spawn |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
param | MaxMailboxSize | Maximum inbox size |
returns | TProcessInterface - The proxy for communicating with the Process |
field State<StrategyContext, Unit> DefaultStrategy = OneForOne(Always(Directive.Restart)) Source #
Default Process strategy if one isn't provided on spawn
Process: Tell functions
'Tell' is used to send a message from one process to another (or from outside a process to a process).
The messages are sent to the process asynchronously and join the process' inbox. The process will
deal with one message from its inbox at a time. It cannot start the next message until it's finished
with a previous message.
method Unit tell <T> (ProcessId pid, T message, ProcessId sender = default(ProcessId)) Source #
Send a message to a process
param | pid | Process ID to send to |
param | message | Message to send |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
method Unit tell <T> (ProcessId pid, T message, Schedule schedule, ProcessId sender = default(ProcessId)) Source #
Send a message at a specified time in the future
param | pid | Process ID to send to |
param | message | Message to send |
param | schedule | A structure that defines the method of delivery of the scheduled message |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
method Unit tell <T> (ProcessId pid, T message, TimeSpan delayFor, ProcessId sender = default(ProcessId)) Source #
Send a message at a specified time in the future
param | pid | Process ID to send to |
param | message | Message to send |
param | delayFor | How long to delay sending for |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
method Unit tell <T> (ProcessId pid, T message, DateTime delayUntil, ProcessId sender = default(ProcessId)) Source #
Send a message at a specified time in the future
It is advised to use the variant that takes a TimeSpan, this will fail to be accurate across a Daylight Saving Time boundary or if you use non-UTC dates
param | pid | Process ID to send to |
param | message | Message to send |
param | delayUntil | Date and time to send |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
method Unit tellChildren <T> (T message, ProcessId sender = default(ProcessId)) Source #
Tell children the same message
param | message | Message to send |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
method Unit tellChildren <T> (T message, Schedule schedule, ProcessId sender = default(ProcessId)) Source #
Tell children the same message, delayed.
param | message | Message to send |
param | schedule | A structure that defines the method of delivery of the scheduled message |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
method Unit tellChildren <T> (T message, TimeSpan delayFor, ProcessId sender = default(ProcessId)) Source #
Tell children the same message, delayed.
param | message | Message to send |
param | delayFor | How long to delay sending for |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
method Unit tellChildren <T> (T message, DateTime delayUntil, ProcessId sender = default(ProcessId)) Source #
Tell children the same message, delayed.
This will fail to be accurate across a Daylight Saving Time boundary
param | message | Message to send |
param | delayUntil | Date and time to send |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
method Unit tellChildren <T> (T message, Func<ProcessId, bool> predicate, ProcessId sender = default(ProcessId)) Source #
Tell children the same message The list of children to send to are filtered by the predicate provided
param | message | Message to send |
param | predicate | The list of children to send to are filtered by the predicate provided |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
method Unit tellChildren <T> (T message, Schedule schedule, Func<ProcessId, bool> predicate, ProcessId sender = default(ProcessId)) Source #
Tell children the same message, delayed. The list of children to send to are filtered by the predicate provided
param | message | Message to send |
param | schedule | A structure that defines the method of delivery of the scheduled message |
param | predicate | The list of children to send to are filtered by the predicate provided |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
method Unit tellChildren <T> (T message, TimeSpan delayFor, Func<ProcessId, bool> predicate, ProcessId sender = default(ProcessId)) Source #
Tell children the same message, delayed. The list of children to send to are filtered by the predicate provided
param | message | Message to send |
param | delayFor | How long to delay sending for |
param | predicate | The list of children to send to are filtered by the predicate provided |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
method Unit tellChildren <T> (T message, DateTime delayUntil, Func<ProcessId, bool> predicate, ProcessId sender = default(ProcessId)) Source #
Tell children the same message, delayed. The list of children to send to are filtered by the predicate provided
This will fail to be accurate across a Daylight Saving Time boundary
param | message | Message to send |
param | delayUntil | Date and time to send |
param | predicate | The list of children to send to are filtered by the predicate provided |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
method Unit tellParent <T> (T message, ProcessId sender = default(ProcessId)) Source #
Send a message to the parent process
param | message | Message to send |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
method Unit tellParent <T> (T message, Schedule schedule, ProcessId sender = default(ProcessId)) Source #
Send a message to the parent process at a specified time in the future
param | message | Message to send |
param | schedule | A structure that defines the method of delivery of the scheduled message |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
method Unit tellParent <T> (T message, TimeSpan delayFor, ProcessId sender = default(ProcessId)) Source #
Send a message to the parent process at a specified time in the future
param | message | Message to send |
param | delayFor | How long to delay sending for |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
method Unit tellParent <T> (T message, DateTime delayUntil, ProcessId sender = default(ProcessId)) Source #
Send a message to the parent process at a specified time in the future
This will fail to be accurate across a Daylight Saving Time boundary
param | message | Message to send |
param | delayUntil | Date and time to send |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
method Unit tellSelf <T> (T message, ProcessId sender = default(ProcessId)) Source #
Send a message to ourself
param | message | Message to send |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
method Unit tellSelf <T> (T message, Schedule schedule, ProcessId sender = default(ProcessId)) Source #
Send a message to ourself at a specified time in the future
param | message | Message to send |
param | schedule | A structure that defines the method of delivery of the scheduled message |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
method Unit tellSelf <T> (T message, TimeSpan delayFor, ProcessId sender = default(ProcessId)) Source #
Send a message to ourself at a specified time in the future
param | message | Message to send |
param | delayFor | How long to delay sending for |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
method Unit tellSelf <T> (T message, DateTime delayUntil, ProcessId sender = default(ProcessId)) Source #
Send a message to ourself at a specified time in the future
This will fail to be accurate across a Daylight Saving Time boundary
param | message | Message to send |
param | delayUntil | Date and time to send |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
method Unit tellChild <T> (ProcessName name, T message, ProcessId sender = default(ProcessId)) Source #
Send a message to a named child process
param | message | Message to send |
param | name | Name of the child process |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
method Unit tellChild <T> (int index, T message, ProcessId sender = default(ProcessId)) Source #
Send a message to a child process (found by index)
Because of the potential changeable nature of child nodes, this will take the index and mod it by the number of children. We expect this call will mostly be used for load balancing, and round-robin type behaviour, so feel that's acceptable.
param | message | Message to send |
param | index | Index of the child process (see remarks) |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
method Validation<string, Msg> WillMyMessageSerialiseAndIsEqual <Msg> (Msg msg) Source #
Support for unit testing message serialisation
method Validation<string, Msg> WillMyMessageSerialise <Msg> (Msg msg) Source #
Support for unit testing message serialisation
The Language Ext process system uses the actor model as seen in Erlang
processes. Actors are famed for their ability to support massive concurrency
through messaging and no shared memory.
https://en.wikipedia.org/wiki/Actor_model
Each process has an 'inbox' and a state. The state is the property of the
process and no other. The messages in the inbox are passed to the process
one at a time. When the process has finished processing a message it returns
its current state. This state is then passed back in with the next message.
You can think of it as a fold over a stream of messages.
A process must finish dealing with a message before another will be given.
Therefore they are blocking. But they block themselves only. The messages
will build up whilst they are processing.
Because of this, processes are also in a 'supervision hierarchy'. Essentially
each process can spawn child-processes and the parent process 'owns' the child.
Processes have a default failure strategy where the process just restarts with
its original state. The inbox always survives a crash and the failed message
is sent to a 'dead letters' process. You can monitor this. You can also provide
bespoke strategies for different types of failure behaviours (See Strategy folder)
So post crash the process restarts and continues processing the next message.
By creating child processes it's possible for a parent process to 'offload'
work. It could create 10 child processes, and simply route the messages it
gets to its children for a very simple load balancer. Processes are very
lightweight and should not be seen as Threads or Tasks. You can create
10s of 1000s of them and it will 'just work'.
Scheduled tasks become very simple also. You can send a process to a message
with a delay. So a background process that needs to run every 30 minutes
can just send itself a message with a delay on it at the end of its message
handler:
tellSelf(unit, TimeSpan.FromMinutes(30));
property IObservable<ShutdownCancellationToken> PreShutdown Source #
Triggers when the Process system shuts down Either subscribe to the OnNext or OnCompleted
property IObservable<SystemName> Shutdown Source #
Triggers when the Process system shuts down Either subscribe to the OnNext or OnCompleted
property IObservable<ProcessLogItem> ProcessSystemLog Source #
Log of everything that's going on in the Languge Ext process system
property ProcessId Self Source #
Current process ID
This should be used from within a process message loop only
property ProcessId Parent Source #
Parent process ID
This should be used from within a process message loop only
property ProcessId Sender Source #
Sender process ID Always valid even if there's not a sender (the 'NoSender' process ID will be provided).
property HashMap<string, ProcessId> Children Source #
Get the child processes of the running process
This should be used from within a process message loop only
property Map<string, ProcessId> ChildrenInOrder Source #
Get the child processes of the running process
This should be used from within a process message loop only
property CancellationToken SelfProcessCancellationToken Source #
Gets a CancellationToken that is in state Cancel when actor will shutdown. This can be used in message loop to e.g. avoid long running message loop blocking actor shutdown.
This should be used from within a process' message loop only
Return True if the message sent is a Tell and not an Ask
This should be used from within a process' message loop only
method ProcessId Root (SystemName system = default(SystemName)) Source #
Root process ID The Root process is the parent of all processes
method ProcessId User (SystemName system = default(SystemName)) Source #
User process ID The User process is the default entry process, your first process spawned will be a child of this process.
method ProcessId DeadLetters (SystemName system = default(SystemName)) Source #
Dead letters process
Subscribe to it to monitor the failed messages (
method ProcessId Errors (SystemName system = default(SystemName)) Source #
Errors process Subscribe to it to monitor the errors thrown
method HashMap<string, ProcessId> children (ProcessId pid) Source #
Get the child processes of the process ID provided
method Map<string, ProcessId> childrenInOrder (ProcessId pid) Source #
Get the child processes of the process ID provided
method ProcessId child (int index) Source #
Get the child processes by index.
Because of the potential changeable nature of child nodes, this will take the index and mod it by the number of children. We expect this call will mostly be used for load balancing, and round-robin type behaviour, so feel that's acceptable.
Immediately kills the Process that is running from within its message loop. It does this by throwing a ProcessKillException which is caught and triggers the shutdown of the Process. Any Process that has a persistent inbox or state will also have its persistent data wiped. If the Process is registered it will have its registration revoked. If you wish for the data to be maintained for future spawns then call Process.shutdown()
This should be used from within a process' message loop only
method Unit shutdown () Source #
Shutdown the currently running process. The shutdown message jumps ahead of any messages already in the process's queue but doesn't exit immediately like kill(). Any Process that has a persistent inbox or state will have its state maintained for future spawns. If you wish for the data to be dropped then call Process.kill()
method Unit kill (ProcessId pid) Source #
Kill a specified running process. Forces the specified Process to shutdown. The kill message jumps ahead of any messages already in the process's queue. Any Process that has a persistent inbox or state will also have its persistent data wiped. If the Process is registered it will also its registration revoked. If you wish for the data to be maintained for future spawns then call Process.shutdown(pid);
method Unit startup (ProcessId pid) Source #
Send StartupProcess message to a process that isn't running (e.g. spawned with Lazy = true)
method Unit shutdown (ProcessId pid) Source #
Shutdown a specified running process. Forces the specified Process to shutdown. The shutdown message jumps ahead of any messages already in the process's queue. Any Process that has a persistent inbox or state will have its state maintained for future spawns. If you wish for the data to be dropped then call Process.kill(pid)
method Unit shutdownSystem (SystemName system) Source #
Shutdown all processes on the specified process-system
method Unit shutdownAll () Source #
Shutdown all processes on all process-systems
method Unit restart (ProcessId pid) Source #
Forces a running process to restart. This will reset its state and drop any subscribers, or any of its subscriptions.
method Unit pause (ProcessId pid) Source #
Pauses a running process. Messages will still be accepted into the Process'
inbox (unless the inbox is full); but they won't be processed until the
Process is unpaused:
param | pid | Process to pause |
method IDisposable pauseFor (ProcessId pid, Time delay) Source #
Pauses a running process. Messages will still be accepted into the Process'
inbox (unless the inbox is full); but they won't be processed until the
Process is unpaused:
param | pid | Process to pause |
method Unit unpause (ProcessId pid) Source #
Un-pauses a paused process. Messages that have built-up in the inbox whilst the Process was paused will be Processed immediately.
param | pid | Process to un-pause |
method bool exists (ProcessId pid) Source #
Find out if a process exists
Rules:
* Local processes - the process must actually be alive and in-memory
* Remote processes - the process must have an inbox to receive messages
and may be active, but it's not required.
* Dispatchers/roles - at least one process in the collection must exist(pid)
* JS processes - not current supported
param | pid | Process ID to check |
returns | True if exists |
method bool ping (ProcessId pid) Source #
Find out if a process exists and is alive
Rules:
* Local processes - the process must actually be running
* Remote processes - the process must actually be running
* Dispatchers/roles - at least one process in the collection must be running
* JS processes - not current supported
param | pid | Process ID to check |
returns | True if exists |
method Unit watch (ProcessId pid) Source #
Watch another Process in case it terminates
param | pid | Process to watch |
method Unit unwatch (ProcessId pid) Source #
Un-watch another Process that this Process has been watching
param | pid | Process to watch |
method Unit watch (ProcessId watcher, ProcessId watching) Source #
Watch for the death of the watching process and tell the watcher process when that happens.
param | watcher | Watcher |
param | watching | Watched |
method Unit unwatch (ProcessId watcher, ProcessId watching) Source #
Stop watching for the death of the watching process
param | watcher | Watcher |
param | watching | Watched |
method int inboxCount (ProcessId pid) Source #
Find the number of items in the Process inbox
param | pid | Process |
returns | Number of items in the Process inbox |
method HashMap<ProcessName, ClusterNode> ClusterNodes (SystemName system = default(SystemName)) Source #
Get a list of cluster nodes that are online
method HashMap<ProcessName, ClusterNode> ClusterNodes24 (SystemName system = default(SystemName)) Source #
Get a list of cluster nodes that have been alive in the past 24 hours
method IEnumerable<ProcessId> resolve (ProcessId pid) Source #
Resolves a ProcessId into the absolute ProcessIds that it represents This allows live resolution of role-based ProcessIds to their real node ProcessIds.
Mostly useful for debugging, but could be useful for layering additional logic to any message dispatch.
param | pid | |
returns | Enumerable of resolved ProcessIds - could be zero length |
method IEnumerable<Type> validMessageTypes (ProcessId pid) Source #
Get the types of messages that the provided ProcessId accepts. Returns an empty list if it can't be resolved for whatever reason (process doesn't exist/JS process/etc.).
param | pid | Process ID to query |
returns | List of types |
method Unit reschedule (ProcessId pid, string key, DateTime when) Source #
Re-schedule an already scheduled message
method Unit reschedule (ProcessId pid, string key, TimeSpan when) Source #
Re-schedule an already scheduled message
method Unit cancelScheduled (ProcessId pid, string key) Source #
Cancel an already scheduled message
Process: Ask functions
'ask' is a request/response system for processes. You can ask a process a question (a message) and it
can reply using the 'Process.reply' function. It doesn't have to and 'ask' will timeout after
ActorConfig.Default.Timeout seconds.
'ask' is blocking, because mostly it will be called from within a process and processes shouldn't
perform asynchronous operations.
method Aff<RT, A> ask <A> (ProcessId pid, object message, ProcessId sender = default(ProcessId)) Source #
Send a message to a process
param | pid | Process ID to send to |
param | message | Message to send |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
method Aff<RT, A> ask <A> (Eff<RT, ProcessId> pid, object message, ProcessId sender = default(ProcessId)) Source #
Send a message to a process
param | pid | Process ID to send to |
param | message | Message to send |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
method Aff<RT, Seq<A>> askChildren <A> (object message, int take = Int32.MaxValue) Source #
Ask children the same message
param | message | Message to send |
param | take | Maximum number of children to ask |
method Aff<RT, A> askParent <A> (object message) Source #
Send a message to the parent process
param | message | Message to send |
method Aff<RT, A> askChild <A> (ProcessName name, A message) Source #
Send a message to a named child process
param | message | Message to send |
param | name | Name of the child process |
method Aff<RT, A> askChild <A> (int index, object message) Source #
Send a message to a child process (found by index)
Because of the potential changeable nature of child nodes, this will take the index and mod it by the number of children. We expect this call will mostly be used for load balancing, and round-robin type behaviour, so feel that's acceptable.
param | message | Message to send |
param | index | Index of the child process (see remarks) |
The Language Ext process system uses the actor model as seen in Erlang
processes. Actors are famed for their ability to support massive concurrency
through messaging and no shared memory.
https://en.wikipedia.org/wiki/Actor_model
Each process has an 'inbox' and a state. The state is the property of the
process and no other. The messages in the inbox are passed to the process
one at a time. When the process has finished processing a message it returns
its current state. This state is then passed back in with the next message.
You can think of it as a fold over a stream of messages.
A process must finish dealing with a message before another will be given.
Therefore they are blocking. But they block themselves only. The messages
will build up whilst they are processing.
Because of this, processes are also in a 'supervision hierarchy'. Essentially
each process can spawn child-processes and the parent process 'owns' the child.
Processes have a default failure strategy where the process just restarts with
its original state. The inbox always survives a crash and the failed message
is sent to a 'dead letters' process. You can monitor this. You can also provide
bespoke strategies for different types of failure behaviours (See Strategy folder)
So post crash the process restarts and continues processing the next message.
By creating child processes it's possible for a parent process to 'offload'
work. It could create 10 child processes, and simply route the messages it
gets to its children for a very simple load balancer. Processes are very
lightweight and should not be seen as Threads or Tasks. You can create
10s of 1000s of them and it will 'just work'.
Scheduled tasks become very simple also. You can send a process to a message
with a delay. So a background process that needs to run every 30 minutes
can just send itself a message with a delay on it at the end of its message
handler:
tellSelf(unit, TimeSpan.FromMinutes(30));
field Eff<RT, SystemName> System Source #
Current system
TODO: This is a placeholder until the current-system becomes part of the HasEcho trait. Its current behaviour is to return the system of the process being run, or if not inside an inbox, the default-system.
field Eff<RT, ProcessId> Self Source #
Current process ID
This should be used from within a process message loop only
field Eff<RT, ProcessId> Parent Source #
Parent process ID
This should be used from within a process message loop only
field Eff<RT, ProcessId> Sender Source #
Sender process ID Always valid even if there's not a sender (the 'NoSender' process ID will be provided).
field Eff<RT, ProcessId> User Source #
User process ID The User process is the default entry process, your first process spawned will be a child of this process.
field Eff<RT, ProcessId> DeadLetters Source #
Dead letters process
Subscribe to it to monitor the failed messages (
field Eff<RT, ProcessId> Root Source #
Root process ID The Root process is the parent of all processes
field Eff<RT, ProcessId> Errors Source #
Errors process Subscribe to it to monitor the errors thrown
field Eff<RT, HashMap<string, ProcessId>> Children Source #
Get the child processes of the running process
This should be used from within a process message loop only
field Eff<RT, Map<string, ProcessId>> ChildrenInOrder Source #
Get the child processes of the running process
This should be used from within a process message loop only
field Eff<RT, Unit> killSelf Source #
Immediately kills the Process that is running from within its message loop. It does this by throwing a ProcessKillException which is caught and triggers the shutdown of the Process. Any Process that has a persistent inbox or state will also have its persistent data wiped. If the Process is registered it will have its registration revoked. If you wish for the data to be maintained for future spawns then call Process.shutdown()
This should be used from within a process' message loop only
field Eff<RT, Unit> shutdownSelf Source #
Shutdown the currently running process. The shutdown message jumps ahead of any messages already in the process's queue but doesn't exit immediately like kill(). Any Process that has a persistent inbox or state will have its state maintained for future spawns. If you wish for the data to be dropped then call Process.kill()
property Eff<RT, Unit> shutdownAll Source #
Shutdown all processes on all process-systems
property Eff<RT, bool> isTell Source #
Return True if the message sent is a Tell and not an Ask
This should be used from within a process' message loop only
property Eff<RT, Unit> assertTell Source #
Assert that the current request is a tell
Fails with 'Tell expected' if the current request isn't a tell Fails with 'Not in a message loop' if we're not in a Process
property Eff<RT, HashMap<ProcessName, ClusterNode>> ClusterNodes Source #
Get a list of cluster nodes that are online
method Aff<RT, HashMap<string, ProcessId>> children (ProcessId pid) Source #
Get the child processes of the process ID provided
method Aff<RT, Map<string, ProcessId>> childrenInOrder (ProcessId pid) Source #
Get the child processes of the process ID provided
method Eff<RT, ProcessId> child (int index) Source #
Get the child processes by index.
Because of the potential changeable nature of child nodes, this will take the index and mod it by the number of children. We expect this call will mostly be used for load balancing, and round-robin type behaviour, so feel that's acceptable.
method Eff<RT, Unit> kill (ProcessId pid) Source #
Kill a specified running process. Forces the specified Process to shutdown. The kill message jumps ahead of any messages already in the process's queue. Any Process that has a persistent inbox or state will also have its persistent data wiped. If the Process is registered it will also its registration revoked. If you wish for the data to be maintained for future spawns then call Process.shutdown(pid);
method Eff<RT, Unit> startup (ProcessId pid) Source #
Send StartupProcess message to a process that isn't running (e.g. spawned with Lazy = true)
method Eff<RT, Unit> shutdown (ProcessId pid) Source #
Shutdown a specified running process. Forces the specified Process to shutdown. The shutdown message jumps ahead of any messages already in the process's queue. Any Process that has a persistent inbox or state will have its state maintained for future spawns. If you wish for the data to be dropped then call Process.kill(pid)
method Eff<RT, Unit> shutdownSystem (SystemName system) Source #
Shutdown all processes on the specified process-system
method Eff<RT, Unit> restart (ProcessId pid) Source #
Forces a running process to restart. This will reset its state and drop any subscribers, or any of its subscriptions.
method Eff<RT, Unit> pause (ProcessId pid) Source #
Pauses a running process. Messages will still be accepted into the Process'
inbox (unless the inbox is full); but they won't be processed until the
Process is un-paused:
param | pid | Process to pause |
method Eff<RT, IDisposable> pauseFor (ProcessId pid, Time delay) Source #
Pauses a running process. Messages will still be accepted into the Process'
inbox (unless the inbox is full); but they won't be processed until the
Process is unpaused:
param | pid | Process to pause |
param | delay | How long to pause for |
method Eff<RT, Unit> unpause (ProcessId pid) Source #
Un-pauses a paused process. Messages that have built-up in the inbox whilst the Process was paused will be Processed immediately.
param | pid | Process to un-pause |
method Aff<RT, bool> exists (ProcessId pid) Source #
Find out if a process exists
Rules:
* Local processes - the process must actually be alive and in-memory
* Remote processes - the process must have an inbox to receive messages
and may be active, but it's not required.
* Dispatchers/roles - at least one process in the collection must exist(pid)
* JS processes - not current supported
param | pid | Process ID to check |
returns | True if exists |
method Aff<RT, bool> ping (ProcessId pid) Source #
Find out if a process exists and is alive
Rules:
* Local processes - the process must actually be running
* Remote processes - the process must actually be running
* Dispatchers/roles - at least one process in the collection must be running
* JS processes - not current supported
param | pid | Process ID to check |
returns | True if exists |
method Eff<RT, Unit> watch (ProcessId pid) Source #
Watch another Process in case it terminates
param | pid | Process to watch |
method Aff<RT, Unit> unwatch (ProcessId pid) Source #
Un-watch another Process that this Process has been watching
param | pid | Process to watch |
method Aff<RT, Unit> watch (ProcessId watcher, ProcessId watching) Source #
Watch for the death of the watching process and tell the watcher process when that happens.
param | watcher | Watcher |
param | watching | Watched |
method Aff<RT, Unit> unwatch (ProcessId watcher, ProcessId watching) Source #
Stop watching for the death of the watching process
param | watcher | Watcher |
param | watching | Watched |
method Aff<RT, int> inboxCount (ProcessId pid) Source #
Find the number of items in the Process inbox
param | pid | Process |
returns | Number of items in the Process inbox |
method Eff<RT, IEnumerable<ProcessId>> resolve (ProcessId pid) Source #
Resolves a ProcessId into the absolute ProcessIds that it represents This allows live resolution of role-based ProcessIds to their real node ProcessIds.
Mostly useful for debugging, but could be useful for layering additional logic to any message dispatch.
param | pid | |
returns | Enumerable of resolved ProcessIds - could be zero length |
method Aff<RT, IEnumerable<Type>> validMessageTypes (ProcessId pid) Source #
Get the types of messages that the provided ProcessId accepts. Returns an empty list if it can't be resolved for whatever reason (process doesn't exist/JS process/etc.).
param | pid | Process ID to query |
returns | List of types |
method Eff<RT, Unit> reschedule (ProcessId pid, string key, DateTime when) Source #
Re-schedule an already scheduled message
method Eff<RT, Unit> reschedule (ProcessId pid, string key, TimeSpan when) Source #
Re-schedule an already scheduled message
method Eff<RT, Unit> cancelScheduled (ProcessId pid, string key) Source #
Cancel an already scheduled message
Process registration - 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.
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("regd-name", 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");
method Eff<RT, ProcessId> find (ProcessName name) Source #
Find a process by its registered name (a kind of DNS for Processes).
Names are registered in roles. This function will find registered processes in the current role only. Use the 'find' variant to find registered processes in other roles.
See 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");
param | name | Process name |
returns | A ProcessId that allows dispatching to the process(es). The result would look like /disp/reg/name |
method Eff<RT, ProcessId> find (ProcessName role, ProcessName name) Source #
Find a process by its registered name (a kind of DNS for Processes) in the role specified.
See 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");
param | role | Process role |
param | name | Process name |
returns | A ProcessId that allows dispatching to the process(es). The result would look like /disp/reg/name |
method Aff<RT, ProcessId> register (ProcessName name) Source #
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.
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
param | name | Name to register under |
returns | A ProcessId that allows dispatching to the process via the name. The result would look like /disp/reg/name |
method Aff<RT, ProcessId> register (ProcessName name, ProcessId process) Source #
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.
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");
param | name | Name to register under |
param | process | Process to be registered |
returns | A ProcessId that allows dispatching to the process(es). The result would look like /disp/reg/name |
method Aff<RT, Unit> deregisterById (ProcessId process) Source #
Deregister a Process from any names it's been registered as.
See remarks.
Any Process (or dispatcher, or role, etc.) can be registered by a name - a kind of DNS for ProcessIds. There can be multiple names associated with a single ProcessId.
This function removes all registered names for a specific ProcessId. If you wish to deregister all ProcessIds registered under a name then use Process.deregisterByName(name)
param | process | Process to be deregistered |
method Aff<RT, Unit> deregisterByName (ProcessName name) Source #
Deregister all Processes associated with a name. NOTE: Be very careful with usage of this function if you didn't handle the registration you are potentially disconnecting many Processes from their registered name.
See remarks.
Any Process (or dispatcher, or role, etc.) can be registered by a name - a kind of DNS for ProcessIds. There can be multiple names associated with a single ProcessId and multiple ProcessIds associated with a name.
This function removes all registered ProcessIds for a specific name. If you wish to deregister all names registered for specific Process then use Process.deregisterById(pid)
param | name | Name of the process to deregister |
Process: Reply functions
The reply functions are used to send responses back to processes that have sent
a message using 'ask'. The replyError variants are for bespoke error handling
but if you let the process throw an exception when something goes wrong, the
Process system will auto-reply with an error response (and throw it for the
process that's asking). If the asking process doesn't capture the error then
it will continue to cascade to the original asking process.
field NoReturn noreply = NoReturn.Default Source #
Use this to cancel a reply in the proxy system
method Eff<RT, Unit> reply <A> (A message) Source #
Reply to an ask
This should be used from within a process' message loop only
method Eff<RT, Unit> replyIfAsked <A> (A message) Source #
Reply if asked
This should be used from within a process' message loop only
method Eff<RT, Unit> replyError (Exception exception) Source #
Reply to an ask with an error
This should be used from within a process' message loop only
method Eff<RT, Unit> replyError (string errorMessage) Source #
Reply to an ask with an error
This should be used from within a process' message loop only
method Eff<RT, Unit> replyErrorIfAsked (Exception exception) Source #
Reply with an error if asked
This should be used from within a process' message loop only
method Eff<RT, Unit> replyErrorIfAsked (string errorMessage) Source #
Reply with an error if asked
This should be used from within a process' message loop only
method Eff<RT, Unit> replyOrTellSender <A> (A message) Source #
Reply to the asker, or if it's not an ask then tell the sender via a message to their inbox.
Process: Spawn functions
The spawn functions create a new process. Processes are either simple message receivers that
don't manage state and therefore only need a messageHandler. Or they manage state over time.
If they manage state then you should also provide a 'setup' function that generates the initial
state. This allows the process system to recover if a process crashes. It can re-call the
setup function to reset the state and continue processing the messages.
method Eff<RT, ProcessId> spawn <T> ( ProcessName Name, Func<T, Aff<RT, Unit>> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, Func<ProcessId, Aff<RT, Unit>> Terminated = null) Source #
Create a new process by name. If this is called from within a process' message loop then the new process will be a child of the current process. If it is called from outside of a process, then it will be made a child of the root 'user' process.
type | T | Type of messages that the child-process can accept |
param | Name | Name of the child-process |
param | Inbox | Function that is the process |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
param | Terminated | Message function to call when a Process [that this Process watches] terminates |
returns | A ProcessId that identifies the child |
method Eff<RT, ProcessId> spawnUnit <T> ( ProcessName Name, Func<T, Aff<RT, Unit>> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, Func<ProcessId, Aff<RT, Unit>> Terminated = null) Source #
Create a new process by name (accepts Unit as a return value instead of void). If this is called from within a process' message loop then the new process will be a child of the current process. If it is called from outside of a process, then it will be made a child of the root 'user' process.
type | T | Type of messages that the child-process can accept |
param | Name | Name of the child-process |
param | Inbox | Function that is the process |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
param | Terminated | Message function to call when a Process [that this Process watches] terminates |
returns | A ProcessId that identifies the child |
method Eff<RT, ProcessId> spawn <S, T> ( ProcessName Name, Aff<RT, S> Setup, Func<S, T, Aff<RT, S>> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, Func<S, ProcessId, Aff<RT, S>> Terminated = null, Func<S, Aff<RT, Unit>> Shutdown = null, bool Lazy = false) Source #
Create a new process by name. If this is called from within a process' message loop then the new process will be a child of the current process. If it is called from outside of a process, then it will be made a child of the root 'user' process.
type | T | Type of messages that the child-process can accept |
param | Name | Name of the child-process |
param | Setup | Startup and restart function |
param | Inbox | Function that is the process |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
param | MaxMailboxSize | Maximum number of messages that can back up in the process |
param | Terminated | Message function to call when a Process [that this Process watches] terminates |
param | Shutdown | Process to call on shutdown |
param | Lazy | If set to true actor will not start automatically, you need to startup(processId) manually |
returns | A ProcessId that identifies the child |
method Eff<RT, Seq<ProcessId>> spawnMany <T> ( int Count, ProcessName Name, Func<T, Aff<RT, Unit>> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, Func<ProcessId, Aff<RT, Unit>> Terminated = null) Source #
Create N child processes. The name provided will be used as a basis to generate the child names. Each child will be named "name-index" where index starts at zero. If this is called from within a process' message loop then the new processes will be a children of the current process. If it is called from outside of a process, then they will be made a child of the root 'user' process.
type | T | Type of messages that the child-process can accept |
param | Count | Number of processes to spawn |
param | Name | Name of the child-process |
param | Inbox | Function that is the process |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
param | MaxMailboxSize | Maximum inbox size |
param | Terminated | Message function to call when a Process [that this Process watches] terminates |
returns | ProcessId IEnumerable |
method Eff<RT, Seq<ProcessId>> spawnMany <S, T> ( int Count, ProcessName Name, Aff<RT, S> Setup, Func<S, T, Aff<RT, S>> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, Func<S, Aff<RT, Unit>> Shutdown = null, Func<S, ProcessId, Aff<RT, S>> Terminated = null) Source #
Create N child processes. The name provided will be used as a basis to generate the child names. Each child will be named "name-index" where index starts at zero. If this is called from within a process' message loop then the new processes will be a children of the current process. If it is called from outside of a process, then they will be made a child of the root 'user' process.
type | T | Type of messages that the child-process can accept |
param | Count | Number of processes to spawn |
param | Setup | Startup and restart function |
param | Name | Name of the child-process |
param | Inbox | Function that is the process |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
param | MaxMailboxSize | Maximum inbox size |
param | Terminated | Message function to call when a Process [that this Process watches] terminates |
returns | ProcessId IEnumerable |
method Eff<RT, Seq<ProcessId>> spawnMany <S, T> ( ProcessName Name, HashMap<int, Aff<RT, S>> Spec, Func<S, T, Aff<RT, S>> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, Func<S, Aff<RT, Unit>> Shutdown = null, Func<S, ProcessId, Aff<RT, S>> Terminated = null) Source #
Create N child processes. The name provided will be used as a basis to generate the child names. Each child will be named "name-index" where index starts at zero. If this is called from within a process' message loop then the new processes will be a children of the current process. If it is called from outside of a process, then they will be made a child of the root 'user' process.
type | S | State type |
type | T | Type of messages that the child-process can accept |
param | Spec | Map of IDs and State for generating child workers |
param | Name | Name of the child-process |
param | Inbox | Function that is the process |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
param | MaxMailboxSize | Maximum inbox size |
param | Terminated | Message function to call when a Process [that this Process watches] terminates |
returns | ProcessId IEnumerable |
Process: Spawn functions
The spawn functions create a new process. Processes are either simple message receivers that
don't manage state and therefore only need a messageHandler. Or they manage state over time.
If they manage state then you should also provide a 'setup' function that generates the initial
state. This allows the process system to recover if a process crashes. It can re-call the
setup function to reset the state and continue processing the messages.
method Eff<RT, ProcessId> spawn <T> ( ProcessName Name, Func<T, Eff<RT, Unit>> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, Func<ProcessId, Eff<RT, Unit>> Terminated = null) Source #
Create a new process by name. If this is called from within a process' message loop then the new process will be a child of the current process. If it is called from outside of a process, then it will be made a child of the root 'user' process.
type | T | Type of messages that the child-process can accept |
param | Name | Name of the child-process |
param | Inbox | Function that is the process |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
param | Terminated | Message function to call when a Process [that this Process watches] terminates |
returns | A ProcessId that identifies the child |
method Eff<RT, ProcessId> spawnUnit <T> ( ProcessName Name, Func<T, Eff<RT, Unit>> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, Func<ProcessId, Eff<RT, Unit>> Terminated = null) Source #
Create a new process by name (accepts Unit as a return value instead of void). If this is called from within a process' message loop then the new process will be a child of the current process. If it is called from outside of a process, then it will be made a child of the root 'user' process.
type | T | Type of messages that the child-process can accept |
param | Name | Name of the child-process |
param | Inbox | Function that is the process |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
param | Terminated | Message function to call when a Process [that this Process watches] terminates |
returns | A ProcessId that identifies the child |
method Eff<RT, ProcessId> spawn <S, T> ( ProcessName Name, Eff<RT, S> Setup, Func<S, T, Eff<RT, S>> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, Func<S, ProcessId, Eff<RT, S>> Terminated = null, Func<S, Eff<RT, Unit>> Shutdown = null, bool Lazy = false) Source #
Create a new process by name. If this is called from within a process' message loop then the new process will be a child of the current process. If it is called from outside of a process, then it will be made a child of the root 'user' process.
type | T | Type of messages that the child-process can accept |
param | Name | Name of the child-process |
param | Setup | Startup and restart function |
param | Inbox | Function that is the process |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
param | MaxMailboxSize | Maximum number of messages that can back up in the process |
param | Terminated | Message function to call when a Process [that this Process watches] terminates |
param | Shutdown | Process to call on shutdown |
param | Lazy | If set to true actor will not start automatically, you need to startup(processId) manually |
returns | A ProcessId that identifies the child |
method Eff<RT, Seq<ProcessId>> spawnMany <T> ( int Count, ProcessName Name, Func<T, Eff<RT, Unit>> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, Func<ProcessId, Eff<RT, Unit>> Terminated = null) Source #
Create N child processes. The name provided will be used as a basis to generate the child names. Each child will be named "name-index" where index starts at zero. If this is called from within a process' message loop then the new processes will be a children of the current process. If it is called from outside of a process, then they will be made a child of the root 'user' process.
type | T | Type of messages that the child-process can accept |
param | Count | Number of processes to spawn |
param | Name | Name of the child-process |
param | Inbox | Function that is the process |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
param | MaxMailboxSize | Maximum inbox size |
param | Terminated | Message function to call when a Process [that this Process watches] terminates |
returns | ProcessId IEnumerable |
method Eff<RT, Seq<ProcessId>> spawnMany <S, T> ( int Count, ProcessName Name, Eff<RT, S> Setup, Func<S, T, Eff<RT, S>> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, Func<S, Eff<RT, Unit>> Shutdown = null, Func<S, ProcessId, Eff<RT, S>> Terminated = null) Source #
Create N child processes. The name provided will be used as a basis to generate the child names. Each child will be named "name-index" where index starts at zero. If this is called from within a process' message loop then the new processes will be a children of the current process. If it is called from outside of a process, then they will be made a child of the root 'user' process.
type | T | Type of messages that the child-process can accept |
param | Count | Number of processes to spawn |
param | Setup | Startup and restart function |
param | Name | Name of the child-process |
param | Inbox | Function that is the process |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
param | MaxMailboxSize | Maximum inbox size |
param | Terminated | Message function to call when a Process [that this Process watches] terminates |
returns | ProcessId IEnumerable |
method Eff<RT, Seq<ProcessId>> spawnMany <S, T> ( ProcessName Name, HashMap<int, Eff<RT, S>> Spec, Func<S, T, Eff<RT, S>> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, Func<S, Eff<RT, Unit>> Shutdown = null, Func<S, ProcessId, Eff<RT, S>> Terminated = null) Source #
Create N child processes. The name provided will be used as a basis to generate the child names. Each child will be named "name-index" where index starts at zero. If this is called from within a process' message loop then the new processes will be a children of the current process. If it is called from outside of a process, then they will be made a child of the root 'user' process.
type | S | State type |
type | T | Type of messages that the child-process can accept |
param | Spec | Map of IDs and State for generating child workers |
param | Name | Name of the child-process |
param | Inbox | Function that is the process |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
param | MaxMailboxSize | Maximum inbox size |
param | Terminated | Message function to call when a Process [that this Process watches] terminates |
returns | ProcessId IEnumerable |
Process: Tell functions
'Tell' is used to send a message from one process to another (or from outside a process to a process).
The messages are sent to the process asynchronously and join the process' inbox. The process will
deal with one message from its inbox at a time. It cannot start the next message until it's finished
with a previous message.
method Eff<RT, Unit> tell <A> (ProcessId pid, A message, ProcessId sender = default(ProcessId)) Source #
Send a message to a process
param | pid | Process ID to send to |
param | message | Message to send |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
method Eff<RT, Unit> tell <A> (Eff<RT, ProcessId> pid, A message, ProcessId sender = default(ProcessId)) Source #
Send a message to a process
param | pid | Process ID to send to |
param | message | Message to send |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
method Eff<RT, Unit> tell <A> (ProcessId pid, A message, Schedule schedule, ProcessId sender = default(ProcessId)) Source #
Send a message at a specified time in the future
param | pid | Process ID to send to |
param | message | Message to send |
param | schedule | A structure that defines the method of delivery of the scheduled message |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
method Eff<RT, Unit> tell <A> (Eff<RT, ProcessId> pid, A message, Schedule schedule, ProcessId sender = default(ProcessId)) Source #
Send a message at a specified time in the future
param | pid | Process ID to send to |
param | message | Message to send |
param | schedule | A structure that defines the method of delivery of the scheduled message |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
method Eff<RT, Unit> tell <A> (ProcessId pid, A message, TimeSpan delayFor, ProcessId sender = default(ProcessId)) Source #
Send a message at a specified time in the future
param | pid | Process ID to send to |
param | message | Message to send |
param | delayFor | How long to delay sending for |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
method Eff<RT, Unit> tell <A> (Eff<RT, ProcessId> pid, A message, TimeSpan delayFor, ProcessId sender = default(ProcessId)) Source #
Send a message at a specified time in the future
param | pid | Process ID to send to |
param | message | Message to send |
param | delayFor | How long to delay sending for |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
method Eff<RT, Unit> tell <A> (ProcessId pid, A message, DateTime delayUntil, ProcessId sender = default(ProcessId)) Source #
Send a message at a specified time in the future
It is advised to use the variant that takes a TimeSpan, this will fail to be accurate across a Daylight Saving Time boundary or if you use non-UTC dates
param | pid | Process ID to send to |
param | message | Message to send |
param | delayUntil | Date and time to send |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
method Eff<RT, Unit> tell <A> (Eff<RT, ProcessId> pid, A message, DateTime delayUntil, ProcessId sender = default(ProcessId)) Source #
Send a message at a specified time in the future
It is advised to use the variant that takes a TimeSpan, this will fail to be accurate across a Daylight Saving Time boundary or if you use non-UTC dates
param | pid | Process ID to send to |
param | message | Message to send |
param | delayUntil | Date and time to send |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
method Eff<RT, Unit> tellChildren <A> (A message, ProcessId sender = default(ProcessId)) Source #
Tell children the same message
param | message | Message to send |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
method Eff<RT, Unit> tellChildren <A> (A message, Schedule schedule, ProcessId sender = default(ProcessId)) Source #
Tell children the same message, delayed.
param | message | Message to send |
param | schedule | A structure that defines the method of delivery of the scheduled message |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
method Eff<RT, Unit> tellChildren <A> (A message, TimeSpan delayFor, ProcessId sender = default(ProcessId)) Source #
Tell children the same message, delayed.
param | message | Message to send |
param | delayFor | How long to delay sending for |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
method Eff<RT, Unit> tellChildren <A> (A message, DateTime delayUntil, ProcessId sender = default(ProcessId)) Source #
Tell children the same message, delayed.
This will fail to be accurate across a Daylight Saving Time boundary
param | message | Message to send |
param | delayUntil | Date and time to send |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
method Eff<RT, Unit> tellChildren <A> (A message, Func<ProcessId, bool> predicate, ProcessId sender = default(ProcessId)) Source #
Tell children the same message The list of children to send to are filtered by the predicate provided
param | message | Message to send |
param | predicate | The list of children to send to are filtered by the predicate provided |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
method Eff<RT, Unit> tellChildren <A> (A message, Schedule schedule, Func<ProcessId, bool> predicate, ProcessId sender = default(ProcessId)) Source #
Tell children the same message, delayed. The list of children to send to are filtered by the predicate provided
param | message | Message to send |
param | schedule | A structure that defines the method of delivery of the scheduled message |
param | predicate | The list of children to send to are filtered by the predicate provided |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
method Eff<RT, Unit> tellChildren <A> (A message, TimeSpan delayFor, Func<ProcessId, bool> predicate, ProcessId sender = default(ProcessId)) Source #
Tell children the same message, delayed. The list of children to send to are filtered by the predicate provided
param | message | Message to send |
param | delayFor | How long to delay sending for |
param | predicate | The list of children to send to are filtered by the predicate provided |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
method Eff<RT, Unit> tellChildren <A> (A message, DateTime delayUntil, Func<ProcessId, bool> predicate, ProcessId sender = default(ProcessId)) Source #
Tell children the same message, delayed. The list of children to send to are filtered by the predicate provided
This will fail to be accurate across a Daylight Saving Time boundary
param | message | Message to send |
param | delayUntil | Date and time to send |
param | predicate | The list of children to send to are filtered by the predicate provided |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
method Eff<RT, Unit> tellParent <A> (A message, ProcessId sender = default(ProcessId)) Source #
Send a message to the parent process
param | message | Message to send |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
method Eff<RT, Unit> tellParent <A> (A message, Schedule schedule, ProcessId sender = default(ProcessId)) Source #
Send a message to the parent process at a specified time in the future
param | message | Message to send |
param | schedule | A structure that defines the method of delivery of the scheduled message |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
method Eff<RT, Unit> tellParent <A> (A message, TimeSpan delayFor, ProcessId sender = default(ProcessId)) Source #
Send a message to the parent process at a specified time in the future
param | message | Message to send |
param | delayFor | How long to delay sending for |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
method Eff<RT, Unit> tellParent <A> (A message, DateTime delayUntil, ProcessId sender = default(ProcessId)) Source #
Send a message to the parent process at a specified time in the future
This will fail to be accurate across a Daylight Saving Time boundary
param | message | Message to send |
param | delayUntil | Date and time to send |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
method Eff<RT, Unit> tellSelf <A> (A message, ProcessId sender = default(ProcessId)) Source #
Send a message to ourself
param | message | Message to send |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
method Eff<RT, Unit> tellSelf <A> (A message, Schedule schedule, ProcessId sender = default(ProcessId)) Source #
Send a message to ourself at a specified time in the future
param | message | Message to send |
param | schedule | A structure that defines the method of delivery of the scheduled message |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
method Eff<RT, Unit> tellSelf <A> (A message, TimeSpan delayFor, ProcessId sender = default(ProcessId)) Source #
Send a message to ourself at a specified time in the future
param | message | Message to send |
param | delayFor | How long to delay sending for |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
method Eff<RT, Unit> tellSelf <A> (A message, DateTime delayUntil, ProcessId sender = default(ProcessId)) Source #
Send a message to ourself at a specified time in the future
This will fail to be accurate across a Daylight Saving Time boundary
param | message | Message to send |
param | delayUntil | Date and time to send |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
method Eff<RT, Unit> tellChild <A> (ProcessName name, A message, ProcessId sender = default(ProcessId)) Source #
Send a message to a named child process
param | message | Message to send |
param | name | Name of the child process |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
method Eff<RT, Unit> tellChild <A> (int index, A message, ProcessId sender = default(ProcessId)) Source #
Send a message to a child process (found by index)
Because of the potential changeable nature of child nodes, this will take the index and mod it by the number of children. We expect this call will mostly be used for load balancing, and round-robin type behaviour, so feel that's acceptable.
param | message | Message to send |
param | index | Index of the child process (see remarks) |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
class ProcessAssert Source #
enum ProcessFlags Source #
class ProcessHub Source #
property Func<ProcessId, bool> RouteValidator Source #
Inject a function that validates incoming message destinations
param | routePredicate | Takes the To of a message and returns True if the message is allowed to pass. |
property HashMap<ClientConnectionId, ClientConnection> Connections Source #
Active client connections
method ClientConnectionId OpenConnection (string remoteIp, Action<ClientMessageDTO> tell) Source #
Register a connection by ID
param | id | Client connection ID |
param | conn | Connection ID |
method ClientConnectionId EnsureConnection (ClientConnectionId id, Action<ClientMessageDTO> tell) Source #
Keep an existing connection alive
method Unit CloseConnection (ClientConnectionId id) Source #
Register a connection by ID
param | id | Client connection ID |
param | conn | Connection ID |
method bool TouchConnection (ClientConnectionId id) Source #
Confirm the client is still there
param | id | ID |
returns | True if the connection is still active |
method bool UnSubscribe (ClientConnectionId id, ProcessId pub, ProcessId sub) Source #
Un-subscribe
Process identifier
Use this to 'tell' a message to a process. It can be serialised and passed around without concerns for internals.
field ProcessId NoSender = new ProcessId() Source #
NoSender process ID
field ProcessId None = new ProcessId() Source #
None process ID
field ProcessId Top = new ProcessId(Sep.ToString()) Source #
Absolute root of the process system
Generate new ProcessId that represents a child of this process ID
returns | Process ID |
property bool IsSelection Source #
Returns true if the ProcessId represents a selection of N process paths
method ProcessId Child (ProcessName name) Source #
Generate new ProcessId that represents a child of this process ID
param | name | Name of the child process |
returns | Process ID |
method ProcessId Child (IEnumerable<ProcessId> name) Source #
Generate new ProcessId that represents a child of this process ID
param | name | Name of the child process |
returns | Process ID |
method IEnumerable<ProcessId> GetSelection () Source #
If this ProcessId represents a selection of N process paths then this function will return those paths as separate ProcessIds.
returns | An enumerable of ProcessIds representing the selection. Zero ProcessIds will be returned if the ProcessId is invalid. One ProcessId will be returned if this ProcessId doesn't represent a selection. |
method string ToString () Source #
Convert the ProcessId to a string
returns | String representation of the process ID |
method int GetHashCode () Source #
Hash code of process ID Do not rely on this between application sessions
returns | Integer hash code |
method ProcessId SetSystem (SystemName system) Source #
Set the Process system that this ProcessId belongs to
method bool StartsWith (ProcessId head) Source #
class ProcessIdExtensions Source #
Extensions methods for ProcessId
method HashMap<string, ProcessId> GetChildren (this ProcessId self) Source #
Get the child processes of this process
method ProcessId GetChild (this ProcessId self, ProcessName name) Source #
Get the child processes by name
method ProcessId GetChild (this ProcessId self, int index) Source #
Get the child processes by index.
Because of the potential changeable nature of child nodes, this will take the index and mod it by the number of children. We expect this call will mostly be used for load balancing, and round-robin type behaviour, so feel that's acceptable.
method ProcessId Register (this ProcessId self) Source #
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.
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
param | name | Name to register under |
returns | A ProcessId that allows dispatching to the process via the name. The result would look like /disp/reg/name |
method ProcessId Register (this ProcessId self, ProcessName name) Source #
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.
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");
param | name | Name to register under |
returns | A ProcessId that allows dispatching to the process via the name. The result would look like /disp/reg/name |
method Unit Kill (this ProcessId self) Source #
Kill the process. Forces the process to shutdown. The kill message jumps ahead of any messages already in the process's queue.
method Unit Shutdown (this ProcessId self) Source #
Kill the process. Forces the process to shutdown. The kill message jumps ahead of any messages already in the process's queue.
method T Ask <T> (this ProcessId pid, object message) Source #
Ask a process for a reply
param | pid | Process to ask |
param | message | Message to send |
returns | The response to the request |
method Unit Subscribe (this ProcessId pid) Source #
Subscribes our inbox to another process publish stream. When it calls 'publish' it will arrive in our inbox.
The process can publish any number of types, any published messages not of type T will be ignored.
This should be used from within a process' message loop only
param | pid | Process to subscribe to |
returns | IDisposable, call IDispose to end the subscription |
method Unit Unsubscribe (this ProcessId pid) Source #
Unsubscribe from a process's publications
param | pid | Process to unsub from |
method IDisposable Subscribe <T> (this ProcessId pid, IObserver<T> observer) Source #
Subscribe to the process publish stream. When a process calls 'publish' it emits messages that can be consumed using this method.
The process can publish any number of types, any published messages not of type T will be ignored.
Because this call is asychronous it could allow access to the message loop, therefore you can't call it from within a process message loop.
returns | IDisposable, call IDispose to end the subscription |
method IDisposable Subscribe <T> (this ProcessId pid, Action<T> onNext, Action<Exception> onError, Action onComplete) Source #
Subscribe to the process publish stream. When a process calls 'publish' it emits messages that can be consumed using this method.
The process can publish any number of types, any published messages not of type T will be ignored.
Because this call is asychronous it could allow access to the message loop, therefore you can't call it from within a process message loop.
returns | IDisposable, call IDispose to end the subscription |
method IDisposable Subscribe <T> (this ProcessId pid, Action<T> onNext, Action<Exception> onError) Source #
Subscribe to the process publish stream. When a process calls 'publish' it emits messages that can be consumed using this method.
The process can publish any number of types, any published messages not of type T will be ignored.
Because this call is asychronous it could allow access to the message loop, therefore you can't call it from within a process message loop.
method IDisposable Subscribe <T> (this ProcessId pid, Action<T> onNext) Source #
Subscribe to the process publish stream. When a process calls 'publish' it emits messages that can be consumed using this method.
The process can publish any number of types, any published messages not of type T will be ignored.
Because this call is asychronous it could allow access to the message loop, therefore you can't call it from within a process message loop.
method IDisposable Subscribe <T> (this ProcessId pid, Action<T> onNext, Action onComplete) Source #
Subscribe to the process publish stream. When a process calls 'publish' it emits messages that can be consumed using this method.
The process can publish any number of types, any published messages not of type T will be ignored.
Because this call is asychronous it could allow access to the message loop, therefore you can't call it from within a process message loop.
returns | IDisposable, call IDispose to end the subscription |
method IObservable<T> Observe <T> (this ProcessId pid) Source #
Get an IObservable for a process publish stream. When a process calls 'publish' it emits messages on the observable returned by this method.
The process can publish any number of types, any published messages not of type T will be ignored.
Because this call is asychronous it could allow access to the message loop, therefore you can't call it from within a process message loop.
returns | IObservable T |
method IObservable<T> ObserveState <T> (this ProcessId pid) Source #
Get an IObservable for a process's state stream. When a process state updates at the end of its message loop it announces it on the stream returned from this method. You should use this for notification only. Never modify the state object belonging to a process. Best practice is to make the state type immutable.
The process can publish any number of types, any published messages not of type T will be ignored.
Because this call is asychronous it could allow access to the message loop, therefore you can't call it from within a process message loop.
returns | IObservable T |
method Unit SubscribeState <T> (this ProcessId pid) Source #
Subscribes our inbox to another process state publish stream. When a process state updates at the end of its message loop it announces it arrives in our inbox. You should use this for notification only. Never modify the state object belonging to a process. Best practice is to make the state type immutable.
The process can publish any number of types, any published messages not of type T will be ignored. This should be used from within a process' message loop only
returns | IObservable T |
method Unit Tell <T> (this ProcessId pid, T message, ProcessId sender = default(ProcessId)) Source #
Send a message to a process
param | pid | Process ID to send to |
param | message | Message to send |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
method Unit Tell <T> (this ProcessId pid, T message, TimeSpan delayFor, ProcessId sender = default(ProcessId)) Source #
Send a message at a specified time in the future
param | pid | Process ID to send to |
param | message | Message to send |
param | delayFor | How long to delay sending for |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
method Unit Tell <T> (this ProcessId pid, T message, DateTime delayUntil, ProcessId sender = default(ProcessId)) Source #
Send a message at a specified time in the future
This will fail to be accurate across a Daylight Saving Time boundary
param | pid | Process ID to send to |
param | message | Message to send |
param | delayUntil | Date and time to send |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
method Unit Tell <T> (this ProcessId pid, T message, Echo.Schedule schedule, ProcessId sender = default(ProcessId)) Source #
Send a message at a specified time in the future
This will fail to be accurate across a Daylight Saving Time boundary
param | pid | Process ID to send to |
param | message | Message to send |
param | schedule | A structure that defines the method of delivery of the scheduled message |
param | sender | Optional sender override. The sender is handled automatically if you do not provide one. |
returns | IDisposable that you can use to cancel the operation if necessary. You do not need to call Dispose for any other reason. |
enum ProcessLogItemType Source #
class ProcessLogItem Source #
property string TypeDisplay Source #
property string DateDisplay Source #
constructor ProcessLogItem (ProcessLogItemType type, string message, Exception exception) Source #
constructor ProcessLogItem (ProcessLogItemType type, string message) Source #
constructor ProcessLogItem (ProcessLogItemType type, Exception exception) Source #
struct ProcessName Source #
Name of a Process in LanguageExt.Process system.
It enforces the rules for process names. Process have the same rules as file-names in windows.
constructor ProcessName (string value) Source #
Ctor
param | value | Process name |
method ProcessName FromSelection (IEnumerable<ProcessId> pids) Source #
method IEnumerable<ProcessId> GetSelection () Source #
method int GetHashCode () Source #
Each node in the cluster has a role name and at all times the cluster-nodes have a list of the alive nodes and their roles (Process.ClusterNodes). Nodes are removed from Process.ClusterNodes if they don't phone in. Process.ClusterNodes is at most 3 seconds out-of-date and can therefore be used to reliably find out which nodes are available and what roles they do.
By using Role.First, Role.Broadcast, Role.LeastBusy, Role.Random and Role.RoundRobin you can build a ProcessId that is resolved at the time of doing a 'tell', 'ask', 'subscribe', etc. This can allow reliable messaging to Processes in the cluster.
field ProcessId Broadcast Source #
A ProcessId that represents a set of nodes in a cluster. When used for operations like 'tell', the message is dispatched to all nodes in the set. See remarks.
You may create a reference to child nodes in the usual way: Role.Broadcast["my-role"]["user"]["child-1"][...]
tell( Role.Broadcast["message-role"]["user"]["message-log"], "Hello" );
field ProcessId LeastBusy Source #
A ProcessId that represents a set of nodes in a cluster. When used for operations like 'tell', the message is dispatched to the least busy from the set. See remarks.
You may create a reference to child nodes in the usual way: Role.LeastBusy["my-role"]["user"]["child-1"][...]
tell( Role.LeastBusy["message-role"]["user"]["message-log"], "Hello" );
field ProcessId Random Source #
A ProcessId that represents a set of nodes in a cluster. When used for operations like 'tell', the message is dispatched to a cryptographically random node from the set. See remarks.
You may create a reference to child nodes in the usual way: Role.Random["my-role"]["user"]["child-1"][...]
tell( Role.Random["message-role"]["user"]["message-log"], "Hello" );
field ProcessId RoundRobin Source #
A ProcessId that represents a set of nodes in a cluster. When used for operations like 'tell', the message is dispatched to the nodes in a round- robin fashion See remarks.
You may create a reference to child nodes in the usual way: Role.RoundRobin["my-role"]["user"]["child-1"][...]
tell( Role.RoundRobin["message-role"]["user"]["message-log"], "Hello" );
field ProcessId First Source #
A ProcessId that represents a set of nodes in a cluster. When used for operations like 'tell', the node names are sorted in ascending order and the message is dispatched to the first one. This can be used for leader election for example. See remarks.
You may create a reference to child nodes in the usual way: Role.First["my-role"]["user"]["child-1"][...]
tell( Role.First["message-role"]["user"]["message-log"], "Hello" );
field ProcessId Second Source #
A ProcessId that represents a set of nodes in a cluster. When used for operations like 'tell', the node names are sorted in ascending order and the message is dispatched to the second one. See remarks.
You may create a reference to child nodes in the usual way: Role.Second["my-role"]["user"]["child-1"][...]
tell( Role.Second["message-role"]["user"]["message-log"], "Hello" );
field ProcessId Third Source #
A ProcessId that represents a set of nodes in a cluster. When used for operations like 'tell', the node names are sorted in ascending order and the message is dispatched to the third one. See remarks.
You may create a reference to child nodes in the usual way: Role.Third["my-role"]["user"]["child-1"][...]
tell( Role.Third["message-role"]["user"]["message-log"], "Hello" );
A ProcessId that represents a set of nodes in a cluster. When used for operations like 'tell', the node names are sorted in descending order and the message is dispatched to the first one. See remarks.
You may create a reference to child nodes in the usual way: Role.Last["my-role"]["user"]["child-1"][...]
tell( Role.Last["message-role"]["user"]["message-log"], "Hello" );
method ProcessId Next (SystemName system = default(SystemName)) Source #
Builds a ProcessId that represents the next node in the role that this node is a part of. If there is only one node in the role then any messages sent will be sent to the leaf-process with itself. Unlike other Roles, you do not specify the role-name as the first child. See remarks.
You may create a reference to child nodes in the usual way: Role.Next["user"]["child-1"][...]
tell( Role.Next["user"]["message-log"], "Hello" );
method ProcessId Prev (SystemName system = default(SystemName)) Source #
Builds a ProcessId that represents the previous node in the role that this node is a part of. If there is only one node in the role then any messages sent will be sent to the leaf-process with itself. Unlike other Roles, you do not specify the role-name as the first child. See remarks.
You may create a reference to child nodes in the usual way: Role.Prev["user"]["child-1"][...]
tell( Role.Prev["user"]["message-log"], "Hello" );
method ProcessId broadcast <S, T> ( ProcessName Name, int Count, Func<S> Setup, Func<S, T, S> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" ) Source #
Spawns a new process with Count worker processes, each message is sent to all worker processes
type | S | State type |
type | T | Message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId broadcast <T> ( ProcessName Name, IEnumerable<ProcessId> Workers, RouterOption Options = RouterOption.Default, ProcessFlags Flags = ProcessFlags.Default, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize ) Source #
Spawns a new process with that routes each message to the Workers in a round robin fashion.
type | S | State type |
type | T | Message type |
param | Name | Delegator process name |
param | Flags | Process flags |
returns | Process ID of the delegator process |
method ProcessId broadcastMap <S, T, U> ( ProcessName Name, int Count, Func<S> Setup, Func<S, U, S> Inbox, Func<T, U> Map, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" ) Source #
Spawns a new process with Count worker processes, each message is sent to all worker processes
type | S | State type |
type | T | Message type |
param | Name | Delegator process name |
param | Map | Message mapping function |
param | Count | Number of worker processes |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId broadcastMap <T, U> ( ProcessName Name, IEnumerable<ProcessId> Workers, Func<T,U> Map, RouterOption Options = RouterOption.Default, ProcessFlags Flags = ProcessFlags.Default, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize ) Source #
Spawns a new process with that routes each message to all workers Each message is mapped before being broadcast.
type | S | State type |
type | T | Message type |
type | U | Mapped message type |
param | Name | Delegator process name |
param | Map | Message mapping function |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId broadcastMapMany <S, T, U> ( ProcessName Name, int Count, Func<S> Setup, Func<S, U, S> Inbox, Func<T, IEnumerable<U>> MapMany, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" ) Source #
Spawns a new process with N worker processes, each message is mapped from T to IEnumerable U before each resulting Us are passed all of the worker processes.
type | T | Message type |
type | U | Mapped message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | map | Maps the message from T to IEnumerable U before each one is passed to the workers |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId broadcastMapMany <T, U> ( ProcessName Name, IEnumerable<ProcessId> Workers, Func<T, IEnumerable<U>> MapMany, RouterOption Options = RouterOption.Default, ProcessFlags Flags = ProcessFlags.Default, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize ) Source #
Spawns a new process with N worker processes, each message is mapped from T to IEnumerable U before each resulting Us are passed all of the worker processes.
type | T | Message type |
type | U | Mapped message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | map | Maps the message from T to IEnumerable U before each one is passed to the workers |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId broadcast <T> ( ProcessName Name, int Count, Action<T> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" ) Source #
Spawns a new process with Count worker processes, each message is sent to one worker process in a round robin fashion.
type | S | State type |
type | T | Message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId broadcastMap <T, U> ( ProcessName Name, int Count, Action<U> Inbox, Func<T, U> Map, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" ) Source #
Spawns a new process with Count worker processes, each message is mapped and sent to one worker process in a round robin fashion.
type | S | State type |
type | T | Message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId broadcastMapMany <T, U> ( ProcessName Name, int Count, Action<U> Inbox, Func<T, IEnumerable<U>> MapMany, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" ) Source #
Spawns a new process with N worker processes, each message is mapped from T to IEnumerable U before each resulting U is passed to the worker processes in a round robin fashion.
type | T | Message type |
type | U | Mapped message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | map | Maps the message from T to IEnumerable U before each one is passed to the workers |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method Func<int, TMsg, int> DefaultHashFunction <TMsg> () Source #
Default hashing function, used by the hashing routers by default if no HashFunc parameter is provided. The function turns a worker-count and message into a worker index
type | TMsg | Message type |
returns | Function that turns a worker-count and message into a worker index |
method ProcessId hash <S, T> ( ProcessName Name, int Count, Func<S> Setup, Func<S, T, S> Inbox, Func<int, T, int> HashFunc = null, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" ) Source #
Spawns a new process with Count worker processes, each message is sent to a worker process by calling GetHashCode on the message and modding by the number of workers, the result is used as the worker index to route to.
type | S | State type |
type | T | Message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId hash <T> ( ProcessName Name, IEnumerable<ProcessId> Workers, Func<int, T, int> HashFunc = null, RouterOption Options = RouterOption.Default, ProcessFlags Flags = ProcessFlags.Default, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize ) Source #
Spawns a new process with that routes each message by calling GetHashCode on the message and modding by the number of workers and using that as the worker index to route to.
type | S | State type |
type | T | Message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId hashMap <S, T, U> ( ProcessName Name, int Count, Func<S> Setup, Func<S, U, S> Inbox, Func<T, U> Map, Func<int, T, int> HashFunc = null, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" ) Source #
Spawns a new process with Count worker processes, each message is sent to a worker process by calling GetHashCode on the message and modding by the number of workers and using that to find the worker index to route to.
type | S | State type |
type | T | Message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId hashMap <T, U> ( ProcessName Name, IEnumerable<ProcessId> Workers, Func<T, U> Map, Func<int, U, int> HashFunc = null, RouterOption Options = RouterOption.Default, ProcessFlags Flags = ProcessFlags.Default, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize ) Source #
Spawns a new process where each message is sent to a worker process by calling GetHashCode on the mapped message and modding it by the number of workers to find the worker index to route to.
type | S | State type |
type | T | Message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId hashMapMany <S, T, U> ( ProcessName Name, int Count, Func<S> Setup, Func<S, U, S> Inbox, Func<T, IEnumerable<U>> MapMany, Func<int, U, int> HashFunc = null, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" ) Source #
Spawns a new process with N worker processes, each message is mapped from T to IEnumerable U before each resulting U is passed to the worker processes by getting each mapped message and calling GetHashCode and modding by the number of workers to find the worker index to route to.
type | T | Message type |
type | U | Mapped message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | map | Maps the message from T to IEnumerable U before each one is passed to the workers |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId hashMapMany <T, U> ( ProcessName Name, IEnumerable<ProcessId> Workers, Func<T, IEnumerable<U>> MapMany, Func<int, U, int> HashFunc = null, RouterOption Options = RouterOption.Default, ProcessFlags Flags = ProcessFlags.Default, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize ) Source #
Spawns a new process with N worker processes, each message is mapped from T to IEnumerable U before each resulting U is passed to the worker processes by getting each mapped message and calling GetHashCode and modding by the number of workers to find the worker index to route to.
type | T | Message type |
type | U | Mapped message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | map | Maps the message from T to IEnumerable U before each one is passed to the workers |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId hash <T> ( ProcessName Name, int Count, Action<T> Inbox, Func<int, T, int> HashFunc = null, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" ) Source #
Spawns a new process with that routes each message by calling GetHashCode on the message and modding by the number of workers and using that as the worker index to route to.
type | S | State type |
type | T | Message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId hashMap <T, U> ( ProcessName Name, int Count, Action<U> Inbox, Func<T, U> Map, Func<int, T, int> HashFunc = null, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" ) Source #
Spawns a new process where each message is sent to a worker process by calling GetHashCode on the mapped message and modding it by the number of workers to find the worker index to route to.
type | S | State type |
type | T | Message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId hashMapMany <T, U> ( ProcessName Name, int Count, Action<U> Inbox, Func<T, IEnumerable<U>> MapMany, Func<int, U, int> HashFunc = null, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" ) Source #
Spawns a new process with N worker processes, each message is mapped from T to IEnumerable U before each resulting U is passed to the worker processes by getting each mapped message and calling GetHashCode and modding by the number of workers to find the worker index to route to.
type | T | Message type |
type | U | Mapped message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | map | Maps the message from T to IEnumerable U before each one is passed to the workers |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId leastBusy <S, T> ( ProcessName Name, int Count, Func<S> Setup, Func<S, T, S> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" ) Source #
Spawns a new process with Count worker processes, each message is sent to the least busy worker.
type | S | State type |
type | T | Message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId leastBusy <T> ( ProcessName Name, IEnumerable<ProcessId> Workers, RouterOption Options = RouterOption.Default, ProcessFlags Flags = ProcessFlags.Default, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize ) Source #
Spawns a new process with that routes each message to the least busy worker.
type | S | State type |
type | T | Message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId leastBusyMap <S, T, U> ( ProcessName Name, int Count, Func<S> Setup, Func<S, U, S> Inbox, Func<T, U> Map, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" ) Source #
Spawns a new process with Count worker processes, each message is mapped and sent to the least busy worker
type | S | State type |
type | T | Message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId leastBusyMap <T, U> ( ProcessName Name, IEnumerable<ProcessId> Workers, Func<T, U> Map, RouterOption Options = RouterOption.Default, ProcessFlags Flags = ProcessFlags.Default, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize ) Source #
Spawns a new process with that routes each message is mapped and sent to the least busy worker
type | S | State type |
type | T | Message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId leastBusy <T> ( ProcessName Name, int Count, Action<T> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" ) Source #
Spawns a new process with Count worker processes, each message is sent to the least busy worker.
type | S | State type |
type | T | Message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId leastBusyMap <T, U> ( ProcessName Name, int Count, Action<U> Inbox, Func<T, U> Map, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" ) Source #
Spawns a new process with Count worker processes, each message is mapped and sent to the least busy worker.
type | S | State type |
type | T | Message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId random <S, T> ( ProcessName Name, int Count, Func<S> Setup, Func<S, T, S> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" ) Source #
Spawns a new process with Count worker processes, each message is sent to one worker process randomly.
type | S | State type |
type | T | Message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId random <T> ( ProcessName Name, IEnumerable<ProcessId> Workers, RouterOption Options = RouterOption.Default, ProcessFlags Flags = ProcessFlags.Default, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize ) Source #
Spawns a new process with that routes each message to the Workers randomly.
type | S | State type |
type | T | Message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId randomMap <S, T, U> ( ProcessName Name, int Count, Func<S> Setup, Func<S, U, S> Inbox, Func<T, U> Map, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" ) Source #
Spawns a new process with Count worker processes, each message is sent to one worker process randomly.
type | S | State type |
type | T | Message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId randomMap <T, U> ( ProcessName Name, IEnumerable<ProcessId> Workers, Func<T, U> Map, RouterOption Options = RouterOption.Default, ProcessFlags Flags = ProcessFlags.Default, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize ) Source #
Spawns a new process with that routes each message to the Workers randomly.
type | S | State type |
type | T | Message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId randomMapMany <S, T, U> ( ProcessName Name, int Count, Func<S> Setup, Func<S, U, S> Inbox, Func<T, IEnumerable<U>> MapMany, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" ) Source #
Spawns a new process with N worker processes, each message is mapped from T to IEnumerable U before each resulting U is passed to the worker processes randomly.
type | T | Message type |
type | U | Mapped message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | map | Maps the message from T to IEnumerable U before each one is passed to the workers |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId randomMapMany <T, U> ( ProcessName Name, IEnumerable<ProcessId> Workers, Func<T, IEnumerable<U>> MapMany, RouterOption Options = RouterOption.Default, ProcessFlags Flags = ProcessFlags.Default, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize ) Source #
Spawns a new process with N worker processes, each message is mapped from T to IEnumerable U before each resulting U is passed to the worker processes randomly.
type | T | Message type |
type | U | Mapped message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | map | Maps the message from T to IEnumerable U before each one is passed to the workers |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId random <T> ( ProcessName Name, int Count, Action<T> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" ) Source #
Spawns a new process with Count worker processes, each message is sent to one worker process in a round robin fashion.
type | S | State type |
type | T | Message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId randomMap <T, U> ( ProcessName Name, int Count, Action<U> Inbox, Func<T, U> Map, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" ) Source #
Spawns a new process with Count worker processes, each message is mapped and sent to one worker process in a round robin fashion.
type | S | State type |
type | T | Message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId randomMapMany <T, U> ( ProcessName Name, int Count, Action<U> Inbox, Func<T, IEnumerable<U>> MapMany, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" ) Source #
Spawns a new process with N worker processes, each message is mapped from T to IEnumerable U before each resulting U is passed to the worker processes in a round robin fashion.
type | T | Message type |
type | U | Mapped message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | map | Maps the message from T to IEnumerable U before each one is passed to the workers |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId roundRobin <S, T> ( ProcessName Name, int Count, Func<S> Setup, Func<S, T, S> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" ) Source #
Spawns a new process with Count worker processes, each message is sent to one worker process in a round robin fashion.
type | S | State type |
type | T | Message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId roundRobin <T> ( ProcessName Name, IEnumerable<ProcessId> Workers, RouterOption Options = RouterOption.Default, ProcessFlags Flags = ProcessFlags.Default, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize ) Source #
Spawns a new process with that routes each message to the Workers in a round robin fashion.
type | S | State type |
type | T | Message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId roundRobinMap <S, T, U> ( ProcessName Name, int Count, Func<S> Setup, Func<S, U, S> Inbox, Func<T, U> Map, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" ) Source #
Spawns a new process with Count worker processes, each message is mapped and sent to one worker process in a round robin fashion.
type | S | State type |
type | T | Message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId roundRobinMap <T, U> ( ProcessName Name, IEnumerable<ProcessId> Workers, Func<T, U> Map, RouterOption Options = RouterOption.Default, ProcessFlags Flags = ProcessFlags.Default, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize ) Source #
Spawns a new process with that routes each message is mapped and sent to the Workers in a round robin fashion.
type | S | State type |
type | T | Message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId roundRobinMapMany <S, T, U> ( ProcessName Name, int Count, Func<S> Setup, Func<S, U, S> Inbox, Func<T, IEnumerable<U>> MapMany, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" ) Source #
Spawns a new process with N worker processes, each message is mapped from T to IEnumerable U before each resulting U is passed to the worker processes in a round robin fashion.
type | T | Message type |
type | U | Mapped message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | map | Maps the message from T to IEnumerable U before each one is passed to the workers |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId roundRobinMapMany <T, U> ( ProcessName Name, IEnumerable<ProcessId> Workers, Func<T, IEnumerable<U>> MapMany, RouterOption Options = RouterOption.Default, ProcessFlags Flags = ProcessFlags.Default, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize ) Source #
Spawns a new process with N worker processes, each message is mapped from T to IEnumerable U before each resulting U is passed to the worker processes in a round robin fashion.
type | T | Message type |
type | U | Mapped message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | map | Maps the message from T to IEnumerable U before each one is passed to the workers |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId roundRobin <T> ( ProcessName Name, int Count, Action<T> Inbox, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" ) Source #
Spawns a new process with Count worker processes, each message is sent to one worker process in a round robin fashion.
type | S | State type |
type | T | Message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId roundRobinMap <T, U> ( ProcessName Name, int Count, Action<U> Inbox, Func<T, U> Map, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" ) Source #
Spawns a new process with Count worker processes, each message is mapped and sent to one worker process in a round robin fashion.
type | S | State type |
type | T | Message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
method ProcessId roundRobinMapMany <T, U> ( ProcessName Name, int Count, Action<U> Inbox, Func<T, IEnumerable<U>> MapMany, ProcessFlags Flags = ProcessFlags.Default, State<StrategyContext, Unit> Strategy = null, int MaxMailboxSize = ProcessSetting.DefaultMailboxSize, string WorkerName = "worker" ) Source #
Spawns a new process with N worker processes, each message is mapped from T to IEnumerable U before each resulting U is passed to the worker processes in a round robin fashion.
type | T | Message type |
type | U | Mapped message type |
param | Name | Delegator process name |
param | Count | Number of worker processes |
param | map | Maps the message from T to IEnumerable U before each one is passed to the workers |
param | Inbox | Worker message handler |
param | Flags | Process flags |
param | Strategy | Failure supervision strategy |
returns | Process ID of the delegator process |
enum RouterOption Source #
method ProcessId fromConfig <T> (ProcessName name) Source #
Spawn a router using the settings in the config
param | name | Name of the child process that will be the router |
returns | ProcessId of the router |
router broadcast1:
pid: /root/user/broadcast1
route: broadcast
worker-count: 10
router broadcast2:
pid: /root/user/broadcast2
route: broadcast
workers: [hello, world]
router least:
pid: /role/user/least
route: least-busy
workers: [one, two, three]
method ProcessId fromConfig <T> (ProcessName name, Func<T, Unit> Inbox) Source #
Spawn a router using the settings in the config
type | T | |
param | name | Name of the child process that will be the router |
returns | ProcessId of the router |
router broadcast1:
pid: /root/user/broadcast1
route: broadcast
worker-count: 10
router broadcast2:
pid: /root/user/broadcast2
route: broadcast
workers: [hello, world]
router least:
pid: /role/user/least
route: least-busy
workers: [one, two, three]
method ProcessId fromConfig <T> (ProcessName name, Action<T> Inbox) Source #
Spawn a router using the settings in the config
type | T | |
param | name | Name of the child process that will be the router |
returns | ProcessId of the router |
router broadcast1:
pid: /root/user/broadcast1
route: broadcast
worker-count: 10
router broadcast2:
pid: /root/user/broadcast2
route: broadcast
workers: [hello, world]
router least:
pid: /role/user/least
route: least-busy
workers: [one, two, three]
method ProcessId fromConfig <S, T> (ProcessName name, Func<S> Setup, Func<S,T,S> Inbox) Source #
Spawn a router using the settings in the config
type | T | |
param | name | Name of the child process that will be the router |
returns | ProcessId of the router |
router broadcast1:
pid: /root/user/broadcast1
route: broadcast
worker-count: 10
router broadcast2:
pid: /root/user/broadcast2
route: broadcast
workers: [hello, world]
router least:
pid: /role/user/least
route: least-busy
workers: [one, two, three]
enum PersistenceType Source #
method Schedule MakeEphemeral () Source #
method Schedule MakePersistent () Source #
method Schedule Persistent (DateTime due) Source #
method Schedule Persistent (TimeSpan due) Source #
method Schedule Persistent (DateTime due, string key) Source #
method Schedule Persistent (TimeSpan due, string key) Source #
method Schedule PersistentAppend <MonoidA, A> (DateTime due, string key) Source #
method Schedule EphemeralAppend <MonoidA, A> (DateTime due, string key) Source #
method Schedule PersistentAppend <MonoidA, A> (TimeSpan due, string key) Source #
method Schedule EphemeralAppend <MonoidA, A> (TimeSpan due, string key) Source #
method Schedule PersistentFold <S, A> (DateTime due, string key, S state, Func<S, A, S> f) Source #
method Schedule EphemeralFold <S, A> (DateTime due, string key, S state, Func<S, A, S> f) Source #
method Schedule PersistentFold <S, A> (TimeSpan due, string key, S state, Func<S, A, S> f) Source #
method Schedule EphemeralFold <S, A> (TimeSpan due, string key, S state, Func<S, A, S> f) Source #
Session ID
It enforces the rules for session IDs.
method SessionId Generate (int sizeInBytes = DefaultSessionIdSizeInBytes) Source #
Make a cryptographically strong session ID
param | sizeInBytes | Size in bytes. This is not the final string length, the final length depends on the Base64 encoding of a byte-array sizeInBytes long. As a guide a 64 byte session ID turns into an 88 character string. |
method int GetHashCode () Source #
struct SupplementarySessionId Source #
Supplementary Session ID
It enforces the rules for session IDs.
field string Key = "sys-supp-session" Source #
Hashfield key for supplementary sessionid
constructor SupplementarySessionId (string value) Source #
Ctor
param | value | SupplementarySessionId |
method SupplementarySessionId Generate (int sizeInBytes = DefaultSessionIdSizeInBytes) Source #
Make a cryptographically strong session ID
param | sizeInBytes | Size in bytes. This is not the final string length, the final length depends on the Base64 encoding of a byte-array sizeInBytes long. As a guide a 64 byte session ID turns into an 88 character string. |
method int GetHashCode () Source #
struct SystemName Source #
Name of a Process System in LanguageExt.Process system.
It enforces the rules for system names. SystemNames have the same rules as file-names in windows.
constructor SystemName (string value) Source #
Ctor
param | value | Process name |
method int GetHashCode () Source #