Skip to content

A prototype implementation of a very simple work queue using redis in python

License

Notifications You must be signed in to change notification settings

kra3/simple-workQ

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple-workQ

A prototype implementation of a very simple work queue based on redis

Planning two endpoints:

  • To submit a job (which returns a unique identifier for the job)
  • To query with job id. (either returns job state or result if finished)

Project outline

  • ws module will have two services, one to submit a summation job; another to query the status of the job.
  • simpleq module will contain simple task queue system and helpers
  • task is the worker, which depends on simpleq module.

Every published message will be kept in a hash with associated meta data and it's job id will be put into schedule queue.

Subscriber process will fetch jobs from schedule queue and move into work queue. Meta data (such as timestamp and status) will be updated with each step.

PS: another thread is needed which should go through worker queue and move long running jobs back to schedule queue. We could spawn it in the subscribe decorator itself, or better kept outside as a separate process.

I'd prefer later, then we have to keep track of queues with subscribers and iterate on corresponding work queues only.

About

A prototype implementation of a very simple work queue using redis in python

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages