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)
| 712 | |
| 713 | |
| 714 | def 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 | |
| 749 | def recv_request(timeout=0): |
nothing calls this directly
no test coverage detected