Jabber-RPC lets you do this. On the callee side you have:
require "jabber/rpc"
class TestAgent < Jabber::RPC::BasicAgent
def exposed_commands
["alive?"]
end
def alive?
true
end
end
agent = TestAgent.new("b...@jabberserver.com/TestAgent", "bot")
agent.connect
On caller, you have:
session = Jabber::Session.bind("user@jabberserver/Ruby", "user")
remote_agent = Jabber::RPC::Client.new(session, "b...@jabberserver.com/TestAgent").proxy3
remote_agent.alive? #=> true
And with a bit more code, remote users can talk to the object through
an IM client, too.
Find it at: http://jabber-rpc.rubyforge.org
Massimiliano
Cool! Testing this has just been added to my todo list ;-)
Raph
A proper install procedure:
mkdir lib/jabber -p
mv rpc.rb lib/jabber/rpc.rb
cp /path/to/setup.rb .
Then build as you would any setup.rbified package.