You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/workflows.md
+4-6Lines changed: 4 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -174,7 +174,7 @@ A temporal query is similar to a temporal signal, both are messages sent to a ru
174
174
The difference is that a signal intends to change the behaviour of the Workflow, whereas a query intends to inspect the current state of the Workflow.
175
175
Querying the state of a Workflow implies that the Workflow must maintain state while running, typically in a clojure [atom](https://clojuredocs.org/clojure.core/atom).
176
176
177
-
#### Registering a query handler
177
+
#### Registering a Query handler
178
178
179
179
To enable querying a Workflow, you may use [temporal.workflow/register-query-handler!](https://cljdoc.org/d/io.github.manetu/temporal-sdk/CURRENT/api/temporal.workflow#register-query-handler!).
180
180
The query handler is a function that has a reference to the Workflow state, usually by closing over it. It interprets the query and returns a response.
@@ -186,16 +186,14 @@ The query handler is a function that has a reference to the Workflow state, usua
186
186
(register-query-handler! (fn [query-type args]
187
187
(when (= query-type :my-query)
188
188
(get-in @state [:path:to:answer]))))
189
-
190
-
;; e.g. react to signals (perhaps in a loop), update the state atom
191
-
189
+
;; e.g. react to signals (perhaps in a loop), updating the state atom
192
190
))
193
191
```
194
192
195
-
#### Querying a running workflow
193
+
#### Querying a Workflow
196
194
197
195
You may query a Workflow with [temporal.client.core/query](https://cljdoc.org/d/io.github.manetu/temporal-sdk/CURRENT/api/temporal.client.core#query).
198
-
A query consists of a `query-type` (keyword) and possibly some `args`.
196
+
A query consists of a `query-type` (keyword) and possibly some `args` (any serializable data structure).
0 commit comments