MCPcopy Index your code
hub / github.com/dovahcrow/sidekiq-rs

github.com/dovahcrow/sidekiq-rs @0.7.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.7.0 ↗ · + Follow
68 symbols 106 edges 13 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Sidekiq-rs Build Status Crates.io Crates.io Crates.io

Sidekiq compatible server in rust, which behaviours totally same as vanilla when you take a look into sidekiq's dashboard.

The basic idea is that, since ruby is slow, we write job handlers in rust with native code. So we write job definitions in ruby and implementations in rust and enqueue jobs in ruby and done jobs in rust.

Snapshots:

dashboard

tui

Usage:

  1. Implementing your own JobHandler
  2. Instantiate a sidekiq-rs server and insert your own job handlers
  3. Set up dummy jobs with same name as your job handlers in ruby
  4. Run sidekiq-rs server and submit jobs from ruby

You can refer to examples/main.rs for building a sidekiq-rs server, and refer to codes in ruby to get an idea on write dummy tasks in ruby.

Advanced usage:

You can definitely embed a ruby VM in your job handlers, running ruby codes when the job is not a native job, so that it soon becomes a complete sidekiq server with additional native code support.

Terminate the sidekiq-rs:

sidekiq-rs includes an implementation of signal handling, and it currently recognize 2 type of signals:

  • SIGINT, fpr force exiting the server. The server will terminate all workers and exit in exactly certain time. The default time is 10 seconds.
  • SIGUSR1, for gracefully exiting the server. The server will inform and wait workers to quit.

Server will not accept anymore jobs if either signal received.

TODO:

  • [x] Sidekiq dashboard capability.
  • [x] Exit signal handling.
  • [x] Support arbitrary fields in job object.
  • [x] Middleware support.
  • [x] Job retry support via middleware.
  • [ ] Documentation.
  • [ ] Unique job support via middleware.
  • [ ] Ruby code handler
  • [ ] Regex handler matching.

Extension points exported contracts — how you extend this code

JMapExt (Interface)
(no doc) [1 implementers]
src/job.rs
MiddleWare (Interface)
(no doc) [1 implementers]
src/middleware.rs
JobHandler (Interface)
(no doc) [1 implementers]
src/job_handler.rs

Core symbols most depended-on inside this repo

with_namespace
called by 7
src/server.rs
identity
called by 4
src/server.rs
with_namespace
called by 4
src/worker.rs
cloned
called by 3
src/middleware.rs
attach_handler
called by 3
src/server.rs
with_server_id
called by 3
src/worker.rs
handle
called by 2
src/middleware.rs
inform_termination
called by 2
src/server.rs

Shape

Method 44
Function 9
Class 8
Enum 4
Interface 3

Languages

Rust91%
Ruby9%

Modules by API surface

src/server.rs19 symbols
src/worker.rs13 symbols
src/job.rs13 symbols
src/middleware.rs6 symbols
src/job_handler.rs6 symbols
examples/main.rs3 symbols
ruby/lib/worker/printer.rb2 symbols
ruby/lib/worker/panic.rb2 symbols
ruby/lib/worker/error.rb2 symbols
src/utils.rs1 symbols
src/lib.rs1 symbols

For agents

$ claude mcp add sidekiq-rs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page