From 3021047637c21378cf6cd9198d9a25423be5c7f3 Mon Sep 17 00:00:00 2001 From: Ivar Refsdal Date: Thu, 23 Sep 2021 11:38:17 +0200 Subject: Document force-retry! --- README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 84dc91b..dab1cef 100644 --- a/README.md +++ b/README.md @@ -229,16 +229,20 @@ For a regular system and/or REPL session you'll want to do: ; Oops I need another consumer. This works fine: (yq/add-consumer! :q-three ...) + +; When the application is shutting down: +(yq/stop!) ``` You may invoke `yq/add-consumer!` and `yq/init!` on a live system as you like. + If you change `:pool-size` or `:poll-delay` you will have to `(yq/stop!)` and `(yq/start!)` to make changes take effect. # Testing For testing you will probably want determinism over an extra threadpool -by enabling the virtual queue: +by using the test queue: ```clojure ... @@ -259,20 +263,16 @@ by enabling the virtual queue: ; tq/consume! consumes one job and asserts that it succeeds. ; It returns the return value of the consumer function - (is (= {:work 123} (tq/consume! :q))))) + (is (= {:work 123} (tq/consume! :q))) + + ; If you want to test the idempotence of your function, + ; you may force retry a consumer function: + ; This may for example be useful to verify that the + ; :db.cas logic is correct. + (is (= {:work 123} (tq/force-retry! :q))))) ``` -## Other features and notes - - -### Logging - - - -### Total health and system sanity - - ### Ordering There is no attempt at ordering the execution of queue jobs. -- cgit v1.2.3