GithubHelp home page GithubHelp logo

burlesque-ruby's Introduction

Burlesque message queue client

Ruby wrapper over Burlesque message queue API

Installation

gem install burlesque-client

Configuration

Client defaults are the same as Burlesque server defaults. If you're using non-standard settings, you can configure client to use them instead.

Burlesque.configure do |c|
  c.host = '10.10.5.155'
  c.port = 4402
  c.timeout = 30
end

Usage

Publish

require 'burlesque'

client = Burlesque::Client.new
queue = 'urgent'
msg = 'Process this message as soon as possible!'

if client.publish(queue, msg)
  puts 'Message successfully published!'
else
  puts 'Failed to publish message'
end

Subscribe

require 'burlesque'

client = Burlesque::Client.new

res = client.subscribe('urgent', 'someday', 'never')
if res.nil?
  puts 'No messages'
else
  puts "Message from queue #{res[:queue]}:"
  puts res[:message]
end

Status

require 'json'
require 'burlesque'

client = Burlesque::Client.new
puts JSON.pretty_generate(client.status)

Debug

require 'json'
require 'burlesque'

client = Burlesque::Client.new
puts JSON.pretty_generate(client.debug)

CLI

$ bsq --help

Usage:
    Publish:
        $ bsq pub urgent "Process this message as soon as possible!"
        or
        $ cat urgent-183.txt | bsq pub urgent
    Subscribe:
        $ bsq sub urgent > urgent-184.txt
    Status:
        $ bsq status
    Debug:
        $ bsq debug

Options:
    -h, --host [HOST]                Burlesque host
    -p, --port [PORT]                Burlesque port
    -t, --timeout [TIMEOUT]          Subscription timeout
    -v, --version                    Display Burlesque Ruby client version
        --help                       Display this help message

Licence

MIT

burlesque-ruby's People

Contributors

localhots avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.