Project

sps-pub

0.0
No commit activity in last 3 years
No release in over 3 years
A SimplePubSub client for publishing messages in 1 line of code.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0.3.0, ~> 0.3
 Project Readme

Subscribe or publish to a SimplePubSub broker in 1 line of code using the SPS-pub gem

Publish example

require 'sps-pub'

# publish the message 'light on', with the topic 'fortina' 
#   to the default SPS broker called 'sps'
#
SPSPub.notice 'fortina: light on'

Subscribe example 1

require 'sps-pub'

# subscribe to all topics on the default SPS broker called 'sps'
#
SPSPub.listen

output:

...
[2013-10-19 14:22] SPS listener INFO ralina: fire down 2
[2013-10-19 14:22] SPS listener INFO xmpp_presence: james@jamesrobertson.eu/talkonaut-S60-3rd_5.71.17_3372124e:
[2013-10-19 14:25] SPS listener INFO magic: testing 126 simplepubsub 

Subscribe example 2

require 'sps-pub'

# subscribe to topic 'fortina' on the default SPS broker called 'sps'
#
SPSPub.listen 'fortina'

spspub sps gem listen notice