From f550e5ac18e4b8f82dcfeca6095b11b91c03e5d6 Mon Sep 17 00:00:00 2001 From: Ivar Refsdal Date: Mon, 27 Sep 2021 10:21:51 +0200 Subject: Document depends-on as a function --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'README.md') 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`. -- cgit v1.2.3