Skip to content

Commit

Permalink
feat: add blocking? option on creation
Browse files Browse the repository at this point in the history
  • Loading branch information
J0sueTM committed Jul 15, 2024
1 parent 240b8b2 commit 74e0211
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/com/moclojer/components/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@
(def setup-logger logs/setup)

(defn new-mq
([workers]
(new-mq workers []))
([workers jobs]
([workers blocking?]
(new-mq workers [] blocking?))
([workers jobs blocking?]
(mq/map->MQ {:workers workers
:jobs jobs})))
:jobs jobs
:blocking? blocking?})))

(defn new-mq-mock
[]
Expand Down
2 changes: 1 addition & 1 deletion src/com/moclojer/components/mq.clj
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
(Thread/sleep sleep)
(recur (inc attempt)))))))))

(defonce mock-channels (atom {}))
(def mock-channels (atom {}))

(defn mock-op-name->op-fn
"Adapts given mq `operation name` to its relative function."
Expand Down

0 comments on commit 74e0211

Please sign in to comment.