Skip to content
Snippets Groups Projects
Commit 703d6b44 authored by Jan David Mol's avatar Jan David Mol
Browse files

Task #8888: Added open() and close() to RPC class to hide implementation...

Task #8888: Added open() and close() to RPC class to hide implementation details of __enter__ and __exit__
parent 3a6cedf9
No related branches found
No related tags found
No related merge requests found
......@@ -93,18 +93,32 @@ class RPC():
if len(kwargs):
raise AttributeError("Unexpected argument passed to RPC class: %s" %( kwargs ))
def open(self):
"""
Start accepting requests.
"""
self.Request.open()
def close(self):
"""
Stop accepting requests.
"""
self.Request.close()
def __enter__(self):
"""
Internal use only. (handles scope 'with')
"""
self.Request.open()
self.open()
return self
def __exit__(self, exc_type, exc_val, exc_tb):
"""
Internal use only. (handles scope 'with')
"""
self.Request.close()
self.close()
def __call__(self, *args, **kwargs):
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment