All Projects → fukamachi → psychiq

fukamachi / psychiq

Licence: other
Background job processing for Common Lisp

Programming Languages

common lisp
692 projects

Projects that are alternatives of or similar to psychiq

Hangfire.topshelf
Best practice for hangfire samples
Stars: ✭ 192 (+326.67%)
Mutual labels:  message-queue
Enqueue Bundle
[READ-ONLY] Message queue bundle for Symfony. RabbitMQ, Amazon SQS, Redis, Service bus, Async events, RPC over MQ and a lot more
Stars: ✭ 233 (+417.78%)
Mutual labels:  message-queue
iris
Lightweight Component Model and Messaging Framework based on ØMQ
Stars: ✭ 50 (+11.11%)
Mutual labels:  message-queue
Phpnats
A PHP client for the NATSio cloud messaging system.
Stars: ✭ 209 (+364.44%)
Mutual labels:  message-queue
Akka Rabbitmq
RabbitMq client in Scala and Akka actors
Stars: ✭ 228 (+406.67%)
Mutual labels:  message-queue
Advanced Java
😮 Core Interview Questions & Answers For Experienced Java(Backend) Developers | 互联网 Java 工程师进阶知识完全扫盲:涵盖高并发、分布式、高可用、微服务、海量数据处理等领域知识
Stars: ✭ 59,142 (+131326.67%)
Mutual labels:  message-queue
Liftbridge
Lightweight, fault-tolerant message streams.
Stars: ✭ 2,175 (+4733.33%)
Mutual labels:  message-queue
haraqa
High Availability Routing and Queueing Application
Stars: ✭ 50 (+11.11%)
Mutual labels:  message-queue
Redis Smq
A simple high-performance Redis message queue for Node.js.
Stars: ✭ 230 (+411.11%)
Mutual labels:  message-queue
microq
Micro job queue built on mongo
Stars: ✭ 67 (+48.89%)
Mutual labels:  message-queue
Vernemq
A distributed MQTT message broker based on Erlang/OTP. Built for high quality & Industrial use cases.
Stars: ✭ 2,628 (+5740%)
Mutual labels:  message-queue
Nats.c
A C client for NATS
Stars: ✭ 220 (+388.89%)
Mutual labels:  message-queue
coronamq
The simplest way to implement a task queue with Java, Vertx and PostgreSQL.
Stars: ✭ 23 (-48.89%)
Mutual labels:  message-queue
Qmq
QMQ是去哪儿网内部广泛使用的消息中间件,自2012年诞生以来在去哪儿网所有业务场景中广泛的应用,包括跟交易息息相关的订单场景; 也包括报价搜索等高吞吐量场景。
Stars: ✭ 2,420 (+5277.78%)
Mutual labels:  message-queue
nodejs-integration-tests-best-practices
✅ Beyond the basics of Node.js testing. Including a super-comprehensive best practices list and an example app (April 2022)
Stars: ✭ 2,842 (+6215.56%)
Mutual labels:  message-queue
Kombu
Kombu is a messaging library for Python.
Stars: ✭ 2,263 (+4928.89%)
Mutual labels:  message-queue
Kmq
Kafka-based message queue
Stars: ✭ 239 (+431.11%)
Mutual labels:  message-queue
fs
[READ-ONLY] Enterprise queue solutions for PHP. Filesystem transport.
Stars: ✭ 32 (-28.89%)
Mutual labels:  message-queue
core
Simple JSON-based messaging queue for inter service communication
Stars: ✭ 28 (-37.78%)
Mutual labels:  message-queue
SPSC Queue
A highly optimized single producer single consumer message queue C++ template
Stars: ✭ 185 (+311.11%)
Mutual labels:  message-queue

Psychiq

Build Status Coverage Status Quicklisp dist

Psychiq provides background job processing for Common Lisp applications inspired by Ruby's Sidekiq.

Warning

This software is still ALPHA quality. The APIs will be likely to change.

Getting Started

Writing a worker

(psy:connect-toplevel :host "localhost" :port 6379)

(defclass my-worker (psy:worker) ())
(defmethod psy:perform ((worker my-worker) &rest args)
  ;; Do something
  )

The worker class is commonly written in an individual ASDF system because it must be shared with clients and servers.

Enqueueing (Client)

;; Enqueueing to "default" queue
(psy:enqueue 'my-worker '("arg1" "arg2"))

;; Enqueueing the job after 300 seconds.
(psy:enqueue-in-sec 300 'my-worker '("arg1" "arg2"))

;; Enqueueing a large number of jobs at a time
;; This is useful if you are pushing tens of thousands of jobs or more
(psy:enqueue-bulk 'my-worker '("arg1" "arg2") '("another" "one") ...)

The arguments must be simple JSON datatypes which can be serialized with Jonathan.

Starting processing (Server)

Psychiq provides a Roswell script for starting processing:

$ psychiq --host localhost --port 6379 --system myapp-workers
$ psychiq -h
Usage: psychiq [option...]

Options:
    -o, --host HOST                 Redis server host (default: localhost)
    -p, --port PORT                 Redis server port (default: 6379)
    -d, --db DBNUM                  Redis server db (default: 0)
    -q, --queue QUEUE[,WEIGHT]      Queues to process with optional weights (several -q's allowed)
    -c, --concurrency INT           Processor threads to use (default: 25)
    -s, --system SYSTEM             ASDF system to load before starting (several -s's allowed)
    -v, --verbose                   Print more verbose output
    -n, --namespace NAMESPACE       Redis namespace (default: "psychiq")
    -V, --version                   Print version
    -h, --help                      Show help

Worker options

(defclass my-worker (psy:worker) ())

;; Specify max retry attempts. (default: 25)
(defmethod psy:worker-max-retries ((worker my-worker))
  1000)

;; Use a named queue to push. (default: "default")
(defmethod psy:worker-queue-name ((worker my-worker))
  "my-worker-queue")

;; Disable jobs going to the dead job queue. (default: T)
(defmethod psy:worker-use-dead-queue-p ((worker my-worker))
  nil)

;; Whether to save any error backtrace in the retry payload. (default: NIL)
(defmethod psy:worker-use-backtrace-p ((worker my-worker))
  t)

Signals

  • INT: graceful shutdown, waits for all processors are idle.
  • TERM: shutdown immediately

Error Handling

When getting an error while performing a job, Psychiq will add the job to the "retry" queue. Jobs in the "retry" queue will be retried automatically with an exponential backoff. After 25 attempts, Psychiq move the job to the "dead" queue.

Web UI

Since the data structure which Psychiq stores in Redis is compatible with Ruby's Resque/Sidekiq, Sidekiq's Web UI can be used.

# config.ru
require 'sidekiq'

Sidekiq.configure_client do |config|
  config.redis = { :size => 1, url: 'redis://localhost:6379', namespace: 'psychiq' }
end

require 'sidekiq/web'
run Sidekiq::Web
$ rackup config.ru

It will be up at http://127.0.0.1:9292 which allows you to see processes and can retry failed jobs manually.

Requirements

  • SBCL (compiled with sb-thread) or Clozure CL
  • Redis
  • Roswell for command-line launcher script.

Installation

$ ros install psychiq

Author

Copyright

Copyright (c) 2015-2017 Eitaro Fukamachi ([email protected])

License

Licensed under the LLGPL License.

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].