All Projects → azutoolkit → joobq

azutoolkit / joobq

Licence: MIT license
JoobQ is a fast, efficient asynchronous reliable job queue and job scheduler library processing. Jobs are submitted to a job queue, where they reside until they are able to be scheduled to run in a computing environment.

Programming Languages

crystal
512 projects

Projects that are alternatives of or similar to joobq

Flask Rq2
A Flask extension for RQ.
Stars: ✭ 176 (+576.92%)
Mutual labels:  queue, scheduler, tasks, jobs
spinach
Modern Redis task queue for Python 3
Stars: ✭ 46 (+76.92%)
Mutual labels:  queue, tasks, jobs
dispatcher
Dispatcher is an asynchronous task queue/job queue based on distributed message passing.
Stars: ✭ 60 (+130.77%)
Mutual labels:  queue, tasks, jobs
theeye-of-sauron
TheEye Dockers and QuickStart
Stars: ✭ 27 (+3.85%)
Mutual labels:  queue, tasks, jobs
Background
Runs things in the background.
Stars: ✭ 497 (+1811.54%)
Mutual labels:  background-jobs, tasks, jobs
Resque Scheduler
A light-weight job scheduling system built on top of Resque
Stars: ✭ 1,713 (+6488.46%)
Mutual labels:  queue, scheduler, background-jobs
josk
🏃🤖 Scheduler and manager for jobs and tasks in node.js on multi-server and clusters setup
Stars: ✭ 27 (+3.85%)
Mutual labels:  scheduler, tasks, jobs
Workq
Job server in Go
Stars: ✭ 1,546 (+5846.15%)
Mutual labels:  queue, scheduler, jobs
Redis Smq
A simple high-performance Redis message queue for Node.js.
Stars: ✭ 230 (+784.62%)
Mutual labels:  queue, jobs
yii2-deferred-tasks
Yii2 extension for handling deferred tasks (background cron jobs)
Stars: ✭ 11 (-57.69%)
Mutual labels:  queue, background-jobs
qless-php
PHP Bindings for qless
Stars: ✭ 25 (-3.85%)
Mutual labels:  queue, jobs
Stevejobs
A simple jobs queue that just works (for Meteor.js)
Stars: ✭ 195 (+650%)
Mutual labels:  queue, jobs
chronus
Chronus是360数科技术团队基于阿里开源项目TBSchedule重写的分布式调度。
Stars: ✭ 174 (+569.23%)
Mutual labels:  scheduler, jobs
Phive Queue
$queue->push('I can be popped off after', '10 minutes');
Stars: ✭ 161 (+519.23%)
Mutual labels:  queue, scheduler
workq
A super tiny work queue
Stars: ✭ 38 (+46.15%)
Mutual labels:  queue, jobs
jobs
RoadRunner: Background PHP workers, Queue brokers
Stars: ✭ 59 (+126.92%)
Mutual labels:  queue, jobs
legacy-bottlerockets
Node.js high availability queue and scheduler for background job processing
Stars: ✭ 25 (-3.85%)
Mutual labels:  queue, background-jobs
async
async is a tiny C++ header-only high-performance library for async calls handled by a thread-pool, which is built on top of an unbounded MPMC lock-free queue.
Stars: ✭ 25 (-3.85%)
Mutual labels:  queue, tasks
angular-gantt-schedule-timeline-calendar-example
Angular gantt-schedule-timeline-calendar usage example
Stars: ✭ 15 (-42.31%)
Mutual labels:  scheduler, tasks
resque-heroku-signals
Patch resque to be compatible with Heroku process signaling
Stars: ✭ 22 (-15.38%)
Mutual labels:  queue, background-jobs

JoobQ

Crystal CI

JoobQ is a fast, efficient asynchronous reliable job queue scheduler library processing. Jobs are submitted to a job queue, where they reside until they are able to be scheduled to run in a compute environment.

Features:

  • Priority queues based on number of workers
  • Reliable queue
  • Error Handling
  • Retry Jobs with automatic Delays
  • Cron Like Periodic Jobs
  • Delayed Jobs
  • Stop execution of workers
  • Jobs expiration

Help Wanted

  • CLI to manage queues and monitor server
  • Rest API: Rest api to schedule jobs
  • Throttle (Rate limit)
  • Approve Queue?: Jobs have to manually approved to execute

Installation

dependencies:
  joobq:
    github: azutoolkit/joobq

Then run:

shards install

Requirements

This project uses REDIS with the TimeSeries module loaded. The Redis TimeSeries is used to monitor stats of job execution the module is free for use and easy to configure. Follow the guidelines at redistimeseries.io

Usage

require "joobq"

Environment variables

REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_POOL_SIZE=50
REDIS_PASS=somepass
REDIS_TIMEOUT=0.2

Defining Queues

Defining Queues: Queues are of type Hash(String, Queue(T)) where the name of the key matches the name of the Queue.

Properties

  • Name: queue:email
  • Number Workers: 10
  • Job Class: TestJob - a class or union of classes

Example

JoobQ.configure do
  queue "single", 10, Job1
  queue "example", 10, ExampleJob | FailJob

  # Scheduling Recurring Jobs
  scheduler do
    cron("*/1 * * * *") { # Do Something }
    cron("*/5 20-23 * * *") { # Do Something }
    every 1.hour, ExampleJob, x: 1
  end
end

Jobs

To define Jobs, must include the JoobQ::Job module, and must implement perform method

struct EmailJob
  include JoobQ::Job
  # Name of the queue to be processed by
  @queue   = "default"
  # Number Of Retries for this job
  @retries = 0
  # Job Expiration
  @expires = 1.days.total_seconds.to_i

  # Initialize as normal with or without named tuple arguments
  def initialize(@email_address : String)
  end

  def perform
    # Logic to handle job execution
  end
end

Executing Job

  # Perform Immediately
  EmailJob.new(email_address: "[email protected]").perform

  # Async - Adds to Queue
  EmailJob.perform(email_address: "[email protected]")

  # Delayed
  EmailJob.delay(for: 1.hour, email_address: "[email protected]")

  # Recurring at given interval
  EmailJob.schedule(every: 1.second, email_address: "[email protected]")

Running JoobQ

Starts JoobQ server and listens for jobs

JoobQ.forge

Statistics

JoobQ includes a Statistics class that allow you get stats about queue performance.

Available stats

total enqueued jobs
total, percent completed jobs
total, percent retry jobs
total, percent dead jobs
total busy jobs
total delayed jobs

Contributing

  1. Fork it (https://github.com/eliasjpr/joobq/fork)
  2. Create your feature branch ( git checkout -b my-new-feature )
  3. Commit your changes ( git commit -am 'Add some feature' )
  4. Push to the branch ( git push origin my-new-feature )
  5. Create a new Pull Request

Contributors

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].