osrf / capabilities

Implements the concept of capabilities as part of the robots-in-concert system.
Other
8 stars 26 forks source link

Issue 19 one bond per user #48

Closed wjwwood closed 10 years ago

wjwwood commented 10 years ago

This is an alternative implementation to issue #19.

It uses one bond per client instead of one bond per capability "use".

@bit-pirate for review

wjwwood commented 10 years ago

@bit-pirate bump on the review

I think this pull request is superior to #19.

The main difference is that #19 establishes one bond per call to /use_capability, whereas this pr establishes one bond per client to the capability server.

19 work flow:

This pull requests work flow:

The entire work flow is hidden by the client API, for both pull requests, this is how the client would use the capabilities.client Python API:

from capabilities.client import Client
client = Client()
# Use the line below if the capability_server has a different name
# client = Client(capability_server_node_name='/capability_server_node_name')
client.wait_for_services()  # Optional
client.use_capability('foo_pkg/Foo')
client.use_capability('foo_pkg/Foo')
client.use_capability('bar_pkg/Bar')
client.free_capability('foo_pkg/Foo')
client.shutdown()
bit-pirate commented 10 years ago

PR #50 fixes the two issues mentioned above. Apart from that this PR looks really nice. I tested freeing/using capabilities and corner cases, such as killing the app manager after an app depending on caps has been started, and it works well (caps get freed correctly)! :+1: