MCPcopy
hub / github.com/dmlc/dgl / send_response

Function send_response

python/dgl/distributed/rpc.py:714–746  ·  view source on GitHub ↗

Send one response to the target client. Serialize the given response object to an :class:`RPCMessage` and send it out. The operation is non-blocking -- it does not guarantee the payloads have reached the target or even have left the sender process. However, all the payloads (i.

(target, response, group_id)

Source from the content-addressed store, hash-verified

712
713
714def send_response(target, response, group_id):
715 """Send one response to the target client.
716
717 Serialize the given response object to an :class:`RPCMessage` and send it
718 out.
719
720 The operation is non-blocking -- it does not guarantee the payloads have
721 reached the target or even have left the sender process. However,
722 all the payloads (i.e., data and arrays) can be safely freed after this
723 function returns.
724
725 Parameters
726 ----------
727 target : int
728 ID of target client.
729 response : Response
730 The response to send.
731 group_id : int
732 Group ID of target client.
733
734 Raises
735 ------
736 ConnectionError if there is any problem with the connection.
737 """
738 service_id = response.service_id
739 msg_seq = get_msg_seq()
740 client_id = target
741 server_id = get_rank()
742 data, tensors = serialize_to_payload(response)
743 msg = RPCMessage(
744 service_id, msg_seq, client_id, server_id, data, tensors, group_id
745 )
746 send_rpc_message(msg, get_client(client_id, group_id))
747
748
749def recv_request(timeout=0):

Callers

nothing calls this directly

Calls 6

get_msg_seqFunction · 0.85
serialize_to_payloadFunction · 0.85
RPCMessageClass · 0.85
send_rpc_messageFunction · 0.85
get_clientFunction · 0.85
get_rankFunction · 0.70

Tested by

no test coverage detected