Sha256: b32f70a9ba765af5a77ee2e67db4ccc9188e93fa7f63673186da358c2837f320

Contents?: true

Size: 344 Bytes

Versions: 14

Compression:

Stored size: 344 Bytes

Contents

setup 'ping-pong@jabber.local', 'ping-pong'

pubsub.host = 'pubsub.jabber.local'

pubsub_event :node => 'ping' do |node|
  pubsub.publish 'pong', node.payload
end

pubsub_event :node => 'pong' do |node|
  x = node.payload.to_i
  if x > 0
    pubsub.publish 'ping', (x - 1)
  else
    shutdown
  end
end

when_ready { pubsub.publish 'ping', 3 }

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
sprsquish-blather-0.4.0 examples/pubsub/ping_pong.rb
sprsquish-blather-0.4.1 examples/pubsub/ping_pong.rb
sprsquish-blather-0.4.2 examples/pubsub/ping_pong.rb
sprsquish-blather-0.4.3 examples/pubsub/ping_pong.rb
sprsquish-blather-0.4.4 examples/pubsub/ping_pong.rb
blather-0.4.7 examples/pubsub/ping_pong.rb
blather-0.4.6 examples/pubsub/ping_pong.rb
blather-0.4.5 examples/pubsub/ping_pong.rb
blather-0.4.4 examples/pubsub/ping_pong.rb
blather-0.4.3 examples/pubsub/ping_pong.rb
blather-0.2.2 examples/pubsub/ping_pong.rb
blather-0.4.2 examples/pubsub/ping_pong.rb
blather-0.4.1 examples/pubsub/ping_pong.rb
blather-0.4.0 examples/pubsub/ping_pong.rb