def recv_request(timeout=0):
    """Receive one request.

    Receive one :class:`RPCMessage` and de-serialize it into a proper Request object.

    The operation is blocking -- it returns when it receives any message
    or it times out.

    Parameters
    ----------
    timeout : int, optional
        The timeout value in milliseconds. If zero, wait indefinitely.

    Returns
    -------
    req : request
        One request received from the target, or None if it times out.
    client_id : int
        Client' ID received from the target, or -1 if it times out.
    group_id : int
        Group' ID received from the target, or -1 if it times out.

    Raises
    ------
    ConnectionError if there is any problem with the connection.
    """
    msg = recv_rpc_message(timeout)
    if msg is None:
        return None, -1, -1
    set_msg_seq(msg.msg_seq)
    req_cls, _ = SERVICE_ID_TO_PROPERTY[msg.service_id]
    if req_cls is None:
        raise DGLError(
            "Got request message from service ID {}, "
            "but no request class is registered.".format(msg.service_id)
        )
    req = deserialize_from_payload(req_cls, msg.data, msg.tensors)
    if msg.server_id != get_rank():
        raise DGLError(
            "Got request sent to server {}, "
            "different from my rank {}!".format(msg.server_id, get_rank())
        )
    return req, msg.client_id, msg.group_id
Receive one request.

    Receive one :class:`RPCMessage` and de-serialize it into a proper Request object.

    The operation is blocking -- it returns when it receives any message
    or it times out.

    Parameters
    ----------
    timeout : int, optional
        The timeout value in milliseconds. If zero, wait indefinitely.

    Returns
    -------
    req : request
        One request received from the target, or None if it times out.
    client_id : int
        Client' ID received from the target, or -1 if it times out.
    group_id : int
        Group' ID received from the target, or -1 if it times out.

    Raises
    ------
    ConnectionError if there is any problem with the connection.
    
python/dgl/distributed/rpc.py