Skip to content
/ spq Public
forked from nathants/spq

simple persistent (extensible) queue

License

Notifications You must be signed in to change notification settings

shareablee/spq

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

why

rabbitmq was complex and inextensible. a queue is a single, atomic thing. there are lots of good uses for that atomicity if the queue can be extended easily.

what

a durable queue exposing all lifecycle methods as http endpoints. new routes can be added, as well as middleware to manipulate calls to existing endpoints.

non goals

  • ultra high performance, http is a bad fit for that.

  • high availability, no clustering or fail over.

  • high durability, it's just local disk.

install

you are going to need leiningen.

git clone https://github.com/nathants/spq
cd spq
lein trampoline run -m spq.server 8080 resources/config.edn

alternately you could build a lein uberjar and run that with java -jar target/spq.jar 8080 resources/config.edn

usage

  • curl shortcuts

    get() { curl -sv localhost:8080${1}; }
    post() { curl -sv -XPOST -H "Content-Type: application/json"' localhost:8080${1}; }
    
  • check

    >> get /stats
    {}
    
  • put

    >> post /put?queue=test -d '{"json": true}'
    
  • stats

    >> get /stats
    {"test": {"queued": 1, "active": 0}}
    
  • take, stats, retry, stats

    >> post /take?queue=test
    Id: 127509770
    {"json": true}
    
    >> get /stats
    {"test": {"queued": 1, "active": 1}}
    
    >> post /retry -d 127509770
    
    >> get /stats
    {"test": {"queued": 1, "active": 0}}
    
  • take, stats, complete, stats

    >> post /take?queue=test
    Id: 224513658
    {"json": true}
    
    >> get /stats
    {"test": {"queued": 1, "active": 1}}
    
    >> post /complete -d 224513658
    
    >> get /stats
    {"test": {"queued": 0, "active": 0}}
    

About

simple persistent (extensible) queue

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Clojure 92.4%
  • Python 4.2%
  • Shell 3.4%