Liking cljdoc? Tell your friends :D

temporal.testing.env

Methods and utilities to assist with unit-testing Temporal workflows

Methods and utilities to assist with unit-testing Temporal workflows
raw docstring

createclj

(create)

Creates a mock Temporal backend, suitable for unit testing.

A worker may be created with start and a client may be connected with get-client

Creates a mock Temporal backend, suitable for unit testing.

A worker may be created with [[start]] and a client may be connected with [[get-client]]
sourceraw docstring

get-clientclj

(get-client env)

Returns a client instance associated with the mock environment created by create

Returns a client instance associated with the mock environment created by [[create]]
sourceraw docstring

startclj

(start env {:keys [task-queue] :as options})

Starts a Temporal worker associated with the mock environment created with create.

Arguments:

(let [env (create)]
  (start env {:task-queue ::my-queue :ctx {:some "context"}})
  ;; create and invoke workflows
  (stop env))
Starts a Temporal worker associated with the mock environment created with [[create]].

Arguments:

  - `options`:  See [[temporal.client.worker/worker-options]]

```clojure
(let [env (create)]
  (start env {:task-queue ::my-queue :ctx {:some "context"}})
  ;; create and invoke workflows
  (stop env))
```
sourceraw docstring

stopclj

(stop env)

Stops the test environment created by create. Does not wait for shutdown to complete. For coordinated shutdown, see synchronized-stop.

(stop instance)
Stops the test environment created by [[create]].  Does not wait for shutdown to complete.  For coordinated shutdown,
see [[synchronized-stop]].

```clojure
(stop instance)
```
sourceraw docstring

synchronized-stopclj

(synchronized-stop env)

Stops the test environment created by create. Blocks until the environment has shut down. For async termination, see stop

(synchronized-stop instance)
Stops the test environment created by [[create]].  Blocks until the environment has shut down.  For async termination,
see [[stop]]

```clojure
(synchronized-stop instance)
```
sourceraw docstring

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

× close