-
Notifications
You must be signed in to change notification settings - Fork 64
Client Agent
nofxx edited this page Sep 12, 2010
·
1 revision
You can call your agents from within an agent. Here is how it works:
Check out the client-agent folder on the repository.
- Make sure you have AMQP setup properly (simpleagent example Testing Nanite)
- run a simple agent (‘nanite-agent —token fred’) in examples/simpleagent
- run ‘nanite-agent —token client’ in this folder
- run ./cli.rb
What’s going on:
The cli.rb mapper sends a request to the client agent, asking for the delegate method:
Nanite.request("/client/delegate", ["/simple/echo", "echo said hello world!"]) do |res| ...
Client agent receives the request and make another request to the nanite we sent as payload (“/simple/echo”)
request(nanite, payload) do |res| ...
And finally, simple agent receives and echo it back to client and then to the mapper.
Obs: “push” is only avaiable on the repository. (sep/09)