Liking cljdoc? Tell your friends :D

com.gfredericks.repl.bg


bgcljmacro

(bg & args)

Runs the body in a background thread, and creates a var for the eventual result. The var will have the optionally supplied name or else will be named bg<N>. Logs to out when the background task starts and finishes.

When the body finishes, the var will contain either the result, or any exception that is thrown.

E.g.,

(bg foo (slurp file)) ;; => #'foo (bg (slurp file)) ;; => #'bg0

The var also contains some useful metadata:

:form - the code of the bg call :state - one of #{:running :done :error} :future - a future-like object that can be derefenced, will block, and will throw an exception when appropriate :thread - the thread object running the code

Runs the body in a background thread, and creates a var for the
eventual result. The var will have the optionally supplied name
or else will be named bg<N>. Logs to *out* when the background
task starts and finishes.

When the body finishes, the var will contain either the result, or
any exception that is thrown.

E.g.,

  (bg foo (slurp file)) ;; => #'foo
  (bg (slurp file)) ;; => #'bg0

The var also contains some useful metadata:

  :form   - the code of the bg call
  :state  - one of #{:running :done :error}
  :future - a future-like object that can be derefenced, will
            block, and will throw an exception when appropriate
  :thread - the thread object running the code
sourceraw docstring

bg-derefcljmacro

(bg-deref bg-name)

Deref's the given bg object's future. Blocks and returns the value, or throws an exception if the bg threw an exception.

Deref's the given bg object's future. Blocks and returns the value,
or throws an exception if the bg threw an exception.
sourceraw docstring

bg-id-counterclj

source

run-and-reportclj

(run-and-report var func)
source

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

× close