

def call_regular(self, remote_ident, method, params):
    req_id = params.get('req_id')
    if (req_id is None):
        req_id = bytes(uuid.uuid4().bytes)
        params['req_id'] = req_id
    if __debug__:
        self.log.debug(('call_regular ident=%r obj=%r method=%r req_id=%s' % (remote_ident, params['object'], params['method'], b2a_hex(req_id))))
    wait = Wait(self, method.call_timeout, remote_ident, req_id)
    with self.cond:
        while True:
            if self.connected.get(remote_ident):
                self.waiting_for_result.add(req_id)
                self.send_params(remote_ident, params, 0)
                while ((req_id not in self.results) and self.connected.get(remote_ident)):
                    wait(PartialCall)
            if self.connected.get(remote_ident):
                res = self.get_result(req_id)
                break
            else:
                wait(NotConnected)
    if res['ok']:
        return res['return']
    else:
        self.raise_remote_exception(res['exception'], res['exception_format'])

dataset/ETHPy150Open dsiroky/snakemq/snakemq/rpc.py RpcClient.call_regular/original