#etcd #message-queue #mq #key-id

etcdmq

Lightweight Message Queue backed by etcd

1 unstable release

0.0.3 Jun 14, 2022

#7 in #key-id

Apache-2.0

17KB
254 lines

etcdmq

A simple message queue on top of etcd

two inputs- watcher, and lister. watcher subscribes to events in the key space, and adds key ID into the queue lister lists all keys in the key space, and adds each item to the queue

  • the queue is read in a loop. a job id is selected
  • client starts a transaction
  • checks if key exists
  • if it does, delete key
  • if it does not, list keys, and try a random key
  • read job data from /job
  • return Task object
    • on drop, Task moves the task state from TaskState::CONSUMED to TaskState::COMPLETED

Dependencies

~9–18MB
~223K SLoC