Commit ecdadf15 authored by Antoine Millet's avatar Antoine Millet
Browse files

Added pop_call method on rpc protocol

parent ee1705e2
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -363,6 +363,15 @@ class RpcProtocol(Protocol):
        err = {'exception': error, 'message': message}
        self._send_response(msg_id, error=err)

    def pop_call(self, msg_id, default=None):
        '''
        Pop a call from the expected call dict.

        :param msg_id: id of the call to pop
        :param default: value to get if no call is found with the provided id
        '''
        return self._calls.pop(msg_id, default)

    def call(self, method_name, *args, **kwargs):
        '''
        Make a new remote call on the peer.