aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvar Refsdal <ivar.refsdal@nsd.no>2021-09-27 10:21:51 +0200
committerIvar Refsdal <ivar.refsdal@nsd.no>2021-09-27 10:21:51 +0200
commitf550e5ac18e4b8f82dcfeca6095b11b91c03e5d6 (patch)
tree53bbdbc25695ddee7f9de6593e0ccaae60ed717a
parentSimplify (diff)
downloadfiinha-f550e5ac18e4b8f82dcfeca6095b11b91c03e5d6.tar.gz
fiinha-f550e5ac18e4b8f82dcfeca6095b11b91c03e5d6.tar.xz
Document depends-on as a function
-rw-r--r--README.md9
1 files changed, 8 insertions, 1 deletions
diff --git a/README.md b/README.md
index 59bbc88..314c779 100644
--- a/README.md
+++ b/README.md
@@ -259,9 +259,16 @@ job to complete before it will be executed:
@(d/transact conn [(yq/put :b
; Payload:
- {:id "b1"}
+ {:id "b1" :a-ref "a1"}
; Jobs options:
{:depends-on [:a "a1"]})])
+
+; depends-on may also be specified as a function of the payload when
+; adding the consumer:
+(yq/add-consumer! :b
+ (fn [payload] ...)
+ {:depends-on (fn [payload]
+ [:a (:a-ref payload)])})
```
Here queue job `b1` will not execute before `a1` is `:done`.