cookpad/barbeque_client

Name: barbeque_client

Owner: Cookpad Inc.

Description: barbeque client for Ruby

Created: 2016-08-30 08:52:37.0

Updated: 2018-04-19 01:59:04.0

Pushed: 2018-04-19 01:59:03.0

Homepage:

Size: 82

Language: Ruby

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

BarbequeClient Build Status

Barbeque client for Ruby.

Installation

Add this line to your application's Gemfile:

'barbeque_client'

And create “config/initializers/barbeque.rb” and edit it like:

equeClient.configure do |config|
nfig.application   = 'cookpad'
nfig.default_queue = 'default'
nfig.endpoint      = 'https://barbeque.example.com'

Usage
Enqueuing a job
ution = BarbequeClient.enqueue(
b:     'NotifyAuthor',       # @param [String] job     - Job name to enqueue.
ssage: { user_id: 7553989 }, # @param [Object] message - An object which is serializable as JSON.
eue:   'default',            # @param optional [String] queue - A queue name to enqueue a job.

ution.message_id #=> "a3c653c1-335e-4d4d-a6f9-eb91c0253d02"
ution.status     #=> "pending"
Polling the job's status
age_id = "a3c653c1-335e-4d4d-a6f9-eb91c0253d02"
equeClient.status(message_id: message_id) #=> "success"
With Rails

Barbeque client has adapter for ActiveJob.

nfig/environments/some_environment.rb
s.application.config.active_job.queue_adapter = :barbeque

And everything will be ok. Don't forget to setup config.application and config.endpoint in somewhere. One more thing, config.default_queue option is meaningless with Rails. default_queue is the fallback option for enqueueing without specified queue name. However, ActiveJob always set default queue as 'default' internally, there is no place to work on. So please use queue_as when you want to use different queue name.

Distributed tracing

Configure tracing option. Pick one of supported tracers. See more detail in https://github.com/cookpad/garage_client#tracing.

equeClient.configure do |config|
...
nfig.tracing = { tracer: 'aws-xray', service: 'barbeque' }


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.