Feature #1140

Implement context manager protocol for participants

Added by J. Moringen almost 9 years ago. Updated almost 8 years ago.

Status:ResolvedStart date:08/16/2012
Priority:NormalDue date:
Assignee:J. Wienke% Done:

100%

Category:Python
Target version:rsb-0.10

Description

So one can write

with rsb.createListener('/bla/') as listener:
    ...

Related issues

Related to Robotics Service Bus - Enhancement #1463: Improve termination of python processes New 04/15/2013

Associated revisions

Revision 6f9738d7
Added by J. Wienke almost 8 years ago

refs #1140: describe context manager protocol

In line with the addition of the context manager protocol to rsb and the
use in the examples, describe it in the manual.

Merge branch 'feature-1140'

Revision 19fa6293
Added by J. Wienke almost 8 years ago

fixes #1140: implement context manager protocol

Added context manager support (with statements) to participants.

Merge branch 'feature-1140'

History

#1 Updated by J. Moringen over 8 years ago

  • Target version changed from rsb-0.9 to rsb-0.10

#2 Updated by J. Wienke almost 8 years ago

  • Status changed from New to In Progress
  • Assignee set to J. Wienke

#3 Updated by J. Wienke almost 8 years ago

  • % Done changed from 0 to 80

I have added an implementation in a feature branch. Can someone please review the proposed changes?

#4 Updated by J. Moringen almost 8 years ago

Looks good. Some minor points:

  • The print statement in the unit test could be removed
  • The example programs in the examples/ directory should be updated
  • If necessary, the manual should be updated

#5 Updated by J. Wienke almost 8 years ago

  • % Done changed from 80 to 90

I have done all of this. Can you have a look again?

#6 Updated by J. Moringen almost 8 years ago

Probably a nitpick but in the manual "context manager protocol" should probably link to the Python documentation since not every user will know the term. Also, listener, informer, etc. should be :term:listener, :term:informer, etc.

#7 Updated by J. Wienke almost 8 years ago

Changed ;)

#8 Updated by J. Wienke almost 8 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 90 to 100

Applied in changeset rsb-python|commit:19fa6293af76e806cc50b3c2dbd4d0f6737e46bd.

Also available in: Atom PDF