aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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`.