Skip to main content

Async Processing

There are a variety of tools that we've used for async processing over the years. Currently, the defacto MQ at Thanx is Sidekiq.

Usage#

Worker#

# app/workers/foo_job.rbclass FooJob  include Sidekiq::Worker  sidekiq_options queue: 'foo'
  def perform(params)    # ...  endend

Enqueue#

FooJob.perform_async(foo: :bar)

Scheduled Jobs#

We are using sidekiq-ent for scheduling.

Historical MQs#

These are MQs that were previously used at Thanx:

  • Resque - Redis-based MQ
    • The usage of Resque in Thanx systems have been replaced by Sidekiq due to significantly increased performance.
  • DelayedJob - DB-based MQ
    • DelayedJob is not performant for any high-traffic system. It's main benefit was to reduce the given service's infrastructural requirements by not requiring a Redis backend. Given the ease of setup of Redis, this gem does not have much use at this point.