def test_retry(self):
"""
If the connection is lost, the L{RemoteObject} created by the creator
will transparently retry to perform the L{MethodCall} requests that
failed due to the broken connection.
"""
self.client.factor = 0.01 # Try reconnecting very quickly
self.client.retryOnReconnect = True
connector = reactor.connectUNIX(self.socket, self.client)
remote = yield self.client.getRemoteObject()
# Disconnect
connector.disconnect()
# This call will fail but it's transparently retried
result = yield remote.method("john")
self.assertEqual(result, "John")
self.client.stopTrying()
connector.disconnect()
评论列表
文章目录