Liking cljdoc? Tell your friends :D

nrepl.util.threading

Functions and tools for dealing with all threads and threadpools necessary for nREPL operation.

Functions and tools for dealing with all threads and threadpools necessary for
nREPL operation.
raw docstring

handle-executorclj

Executor used to run the handler loop and handle individual requests.

Executor used to run the handler loop and handle individual requests.
sourceraw docstring

interrupt-stopclj

(interrupt-stop t)

This works as follows

  1. Calls interrupt
  2. Wait 100ms. This is mainly to allow thread that respond quickly to interrupts to send a message back in response to the interrupt. Significantly, this includes an exception thrown by Thread/sleep.
  3. Asynchronously: wait another force-stop-delay-ms (5000ms) for the thread to cleanly terminate. Only calls .stop if it fails to do so (and risk state corruption)

This set of behaviours strikes a balance between allowing a thread to respond to an interrupt, but also ensuring we actually kill runaway processes.

This works as follows

1. Calls interrupt
2. Wait 100ms. This is mainly to allow thread that respond quickly to
   interrupts to send a message back in response to the interrupt. Significantly,
   this includes an exception thrown by `Thread/sleep`.
3. Asynchronously: wait another `force-stop-delay-ms` (5000ms) for the thread
   to cleanly terminate. Only calls `.stop` if it fails to do so (and risk
   state corruption)

This set of behaviours strikes a balance between allowing a thread to respond
to an interrupt, but also ensuring we actually kill runaway processes.
sourceraw docstring

listen-executorclj

Executor used to accept incoming connections.

Executor used to accept incoming connections.
sourceraw docstring

run-withcljmacro

(run-with executor & body)

Run the provided body using executor. Don't wait for the result (unless the executor itself is blocking).

Run the provided `body` using `executor`. Don't wait for the result (unless the
executor itself is blocking).
sourceraw docstring

thread-factoryclj

(thread-factory thread-name-fmt)

Return a thread factory that produces daemon threads with the name specified by thread-name-fmt.

Return a thread factory that produces daemon threads with the name specified by
`thread-name-fmt`.
sourceraw docstring

thread-reaper-executorclj

Executor used to kill session threads that did not respond to interrupt.

Executor used to kill session threads that did not respond to interrupt.
sourceraw docstring

transport-executorclj

Executor used to run the transport run the handler loop and handle individual requests.

Executor used to run the transport  run the handler loop and handle individual requests.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close