Skip to content
Mike Perham edited this page Jun 10, 2016 · 5 revisions

In Sidekiq, a Worker is a class that executes jobs based on the arguments passed into its perform method.

class MyWorker
  include Sidekiq::Worker

  def perform(user_id : Int64, email : String)
    # do something
  end
end

You create a job using the async API:

jid = MyWorker.async.perform(123_i64, "hello@example.com")

You'll get back a JID, a unique identifier for every job you create.

Clone this wiki locally