Liking cljdoc? Tell your friends :D
Clojure only.

temporal.activity

Methods for defining and invoking activity tasks

Methods for defining and invoking activity tasks
raw docstring

defactivitycljmacro

(defactivity name params* & body)

Defines a new activity, similar to defn, expecting a 2-arity parameter list and body. Should evaluate to something serializable, which will be available to the invoke caller.

Arguments:

(defactivity greet-activity
    [ctx {:keys [name] :as args}]
    (str "Hi, " name))
Defines a new activity, similar to defn, expecting a 2-arity parameter list and body.  Should evaluate to something
serializable, which will be available to the [[invoke]] caller.

Arguments:

- `ctx`: Context passed through from [[temporal.client.worker/start]]
- `args`: Passed from 'params' of [[invoke]]

```clojure
(defactivity greet-activity
    [ctx {:keys [name] :as args}]
    (str "Hi, " name))
```
sourceraw docstring

invokeclj

(invoke activity params)
(invoke activity params options)

Invokes 'activity' with 'params' from within a workflow context. Returns a promise that when derefed will resolve to the evaluation of the defactivity once the activity concludes.

(defactivity my-activity
   [ctx {:keys [foo] :as args}]
   ...)

(invoke my-activity {:foo "bar"} {:start-to-close-timeout (Duration/ofSeconds 3))
Invokes 'activity' with 'params' from within a workflow context.  Returns a promise that when derefed will resolve to
the evaluation of the defactivity once the activity concludes.

```clojure
(defactivity my-activity
   [ctx {:keys [foo] :as args}]
   ...)

(invoke my-activity {:foo "bar"} {:start-to-close-timeout (Duration/ofSeconds 3))
```
sourceraw docstring

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

× close