Allow synchronous RPC-calls to timeout
|Assignee:||J. Moringen||% Done:|
Currently, it is not possible to call an RPC function 'synchronously' with a timeout. This means all calls executed this way will block forever if the RPC call is not answered.
Since the synchronous call is more or less a wrapper for the async version, it would be useful to add the timeout keyword to call of RemoteMethod:
# patterns/__init__.py class RemoteMethod (Method): ... def __call__(self, arg = None, timeout = 0): ... return self.async(arg).get(timeout)
This current workaround with server.method.async(arg).get(timeout) is a bit tedious.
RemoteMethod.__call__ accepts timeout parameter in rsb/patterns/__init__.py
- rsb/patterns/__init__.py (header): updated copyright
(RemoteMethod.__call__): accept timeout parameter; pass to
Future.get; updated documentation
- test/patterns_test.py (RoundTripTest.testRoundTrip): tests
synchronous call with timeout
#3 Updated by J. Moringen almost 5 years ago
- Status changed from In Progress to Resolved
- % Done changed from 0 to 100
Applied in changeset rsb-python|cd7d7cf1c78dea02d30f177e86bf46fa01502c07.