Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tag: v0.1.5
Fetching contributors…

Cannot retrieve contributors at this time

executable file 66 lines (53 sloc) 1.632 kB
#!/usr/bin/env ruby
require 'rubygems'
require File.dirname(__FILE__) + '/lib/pelvis'
require 'pelvis/protocols/xmpp'
require File.dirname(__FILE__) + '/examples/actors/herault'
require File.dirname(__FILE__) + '/examples/actors/randomz'
require File.dirname(__FILE__) + '/examples/actors/chained'
require File.dirname(__FILE__) + '/examples/actors/inner'
require File.dirname(__FILE__) + '/examples/delegates/debugger'
if ENV["DEBUGGER"]
Pelvis.logger.level = Logger::DEBUG
Blather::LOG.level = Logger::DEBUG
end
def connect_herault
Pelvis.connect(:xmpp, :jid => "herault@localhost/agent", :password => "testing", :advertise => false) do |agent|
agent.add_actor Herault
agent.on_advertised do
puts "herault is ready"
connect_chained
end
end
end
def connect_chained
Pelvis.connect(:xmpp, :jid => "dummy@localhost/agent", :password => "testing") do |agent|
agent.add_actor Randomz
agent.add_actor Chained
agent.on_advertised do
puts "chained is ready"
connect_inner
end
end
end
def connect_inner
Pelvis.connect(:xmpp, :jid => "dummy2@localhost/agent", :password => "testing") do |agent|
agent.add_actor Inner
agent.on_advertised do
puts "inner is ready"
connect_bar
end
end
end
def connect_bar
Pelvis.connect(:xmpp, :jid => "admin@localhost/agent", :password => "testing") do |agent|
agent.on_advertised do
puts "bar is ready"
agent.request(:all, "/do/random", {}, :delegate => Debugger.new)
agent.request(:all, "/chained", {}, :delegate => Debugger.new)
end
end
end
EM.run do
connect_herault
end
Jump to Line
Something went wrong with that request. Please try again.