Process creation: spawn, spawn-link, spawn-opt.
Single-thread model: each process runs in one virtual thread. Exit signals are handled by interrupting the thread directly. Pids are Thread objects.
Process creation: spawn, spawn-link, spawn-opt. Single-thread model: each process runs in one virtual thread. Exit signals are handled by interrupting the thread directly. Pids are Thread objects.
(spawn-process {:keys [func args link-to watcher-pid monitor? reg-name flags
ex->reason-fn]})Internal spawn implementation. Returns pid (Thread), or [pid mon-ref] if monitoring.
Options:
Internal spawn implementation. Returns pid (Thread), or [pid mon-ref] if monitoring.
Options:
- :func - the function to run
- :args - arguments to pass to func
- :link-to - pid to link to (for spawn-link)
- :watcher-pid - pid that will receive monitor notifications
- :monitor? - whether to set up a monitor
- :reg-name - name to register the process as
- :flags - map of process flags (e.g., {:trap-exit true})
- :ex->reason-fn - function to convert exceptions to exit reasons (default: exit/ex->reason)(spawn-process-async opts)Async version of spawn-process. Returns a vfuture that will resolve to pid (or [pid ref]). Does not block the caller - process starts in background.
Async version of spawn-process. Returns a vfuture that will resolve to pid (or [pid ref]). Does not block the caller - process starts in background.
(spawn-process-with-result {:keys [func args link-to watcher-pid monitor?
reg-name flags ex->reason-fn]})Like spawn-process but returns [pid user-result-promise]. Used by async to get access to the result promise before process terminates.
Like spawn-process but returns [pid user-result-promise]. Used by async to get access to the result promise before process terminates.
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 |