Liking cljdoc? Tell your friends :D

loom-otp.process.spawn

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.
raw docstring

spawn-processclj

(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:

  • :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)
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)
sourceraw docstring

spawn-process-asyncclj

(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.
sourceraw docstring

spawn-process-with-resultclj

(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.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close