Project

fanout

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
A Ruby convenience library for publishing messages to Fanout.io using the EPCP protocol
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

ruby-fanout

Author: Konstantin Bokarius kon@fanout.io

A Ruby convenience library for publishing messages to Fanout.io using the EPCP protocol.

License

ruby-fanout is offered under the MIT license. See the LICENSE file.

Installation

gem install fanout

Usage

require 'fanout'

def callback(result, message)
  if result
    puts 'Publish successful'
  else
    puts 'Publish failed with message: ' + message.to_s
  end
end

# Omitting the realm and key arguments causes Fanout to use
# the FANOUT_REALM and FANOUT_KEY environmental variables.
fanout = Fanout.new

# Alternatively specify the realm and/or key.
fanout = Fanout.new('<myrealm>', '<myrealmkey>')

fanout.publish('<channel>', 'Test publish!')
fanout.publish_async('<channel>', 'Test async publish!',
    nil, nil, method(:callback))