Liking cljdoc? Tell your friends :D

taskmaster.queue


Consumerclj

source

put!clj

(put! conn {:keys [queue-name payload]})

Put a job on a queue - payload has to be JSON-able, or a string

Put a job on a queue - payload has to be JSON-able, or a string
sourceraw docstring

start!clj

(start! conn {:keys [queue-name handler concurrency]})

Core job consuming and processing logic. Resturns a Consumer record ,which holds the following

  • listener thread which pulls notifications from PG, and then finds next suitable record (or records) to process for given queue-name option
  • a ConcurrentLinkedQueue instance which is used as an internal queue representation to farily distribute individual payloads to multiple consumer threads (number is controlled by concurrency option
  • each job is processed by a handler function, which receives a map of {id payload queue-name} Consumer can be closed with with-close etc
Core job consuming and processing logic.
Resturns a Consumer record ,which holds the following
- listener thread which pulls notifications from PG, and then finds next suitable record (or records) to process
  for given `queue-name` option
- a ConcurrentLinkedQueue instance which is used as an internal queue representation to
  farily distribute individual payloads to multiple consumer threads (number is controlled by `concurrency` option
- each job is processed by a `handler` function, which receives a map of `{id payload queue-name}`
Consumer can be closed with `with-close` etc
sourceraw docstring

stop!clj

(stop! consumer)

Stops the consumer, publishers are unstoppable

Stops the consumer, publishers are unstoppable
sourceraw docstring

valid-queue-name?clj

(valid-queue-name? q)

Ensure there is a queue name and that it doesn't contain . in the name

Ensure there is a queue name and that it doesn't contain . in the name
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close