Minimal core process primitives: current process, messaging, exit signal handling.
This namespace provides the foundation that other process.* namespaces build on. Pids are Thread objects.
Process identity is determined by Thread -> process-map lookup in ConcurrentHashMap. One process = one thread = one mailbox. No cross-thread context sharing.
Minimal core process primitives: current process, messaging, exit signal handling. This namespace provides the foundation that other process.* namespaces build on. Pids are Thread objects. Process identity is determined by Thread -> process-map lookup in ConcurrentHashMap. One process = one thread = one mailbox. No cross-thread context sharing.
(get-proc pid)Get process by pid (Thread). Returns nil if not found.
Get process by pid (Thread). Returns nil if not found.
(get-user-result pid)Get the user-result promise from a process by pid. Returns nil if process doesn't exist or has no user-result.
Get the user-result promise from a process by pid. Returns nil if process doesn't exist or has no user-result.
(message-context)Get the current process's message context. Returns {} if called outside a process.
Get the current process's message context.
Returns {} if called outside a process.(process-exists? pid)Check if process exists in the process table.
Check if process exists in the process table.
(self)Return the pid (Thread) of the current process. Must be called from within a process.
Return the pid (Thread) of the current process. Must be called from within a process.
(self-proc)Return the current process map. Internal use.
Return the current process map. Internal use.
(send dest message)Send message to destination (pid/Thread or registered name). Returns true if delivered. Message is wrapped with sender's context for propagation.
Send message to destination (pid/Thread or registered name). Returns true if delivered. Message is wrapped with sender's context for propagation.
(send-exit-signal! to-pid from-pid reason ctx)Send exit signal to a process. Handles trap-exit semantics.
ctx is the context from the signaling/dying process. Returns true if signal was sent, false if target doesn't exist.
Send exit signal to a process. Handles trap-exit semantics. - If trap-exit=true: converts to [:EXIT from reason] message - If reason=:kill: interrupts thread with :killed - If reason=:normal (or [:normal x]) and not trapping: ignored - Otherwise: sets exit reason and interrupts thread ctx is the context from the signaling/dying process. Returns true if signal was sent, false if target doesn't exist.
(try-self)Return the pid (Thread) of the current process, or nil if not in a process context.
Return the pid (Thread) of the current process, or nil if not in a process context.
(update-message-context! ctx)Merge ctx into current process's message context. No-op if called outside a process or ctx is nil/empty.
Merge ctx into current process's message context. No-op if called outside a process or ctx is nil/empty.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |