template<typename
Queue = Gcs_mpsc_queue<xcom_input_request, xcom_input_request_ptr_deleter>>
class Gcs_xcom_input_queue_impl< Queue >::Reply
Wraps XCom's reply to a queued request.
A request sent to XCom contains three important pieces of data:
- The payload, i.e. what we want XCom to do
- A function instructing XCom how to reply to the request
- A Reply object (For more details please see xcom_input_request.)
When GCS pushes a request to XCom, GCS receives back a future pointer to the Reply object associated with the request. (future_reply) Basically, this future's result is equivalent to the reply GCS would get if it used a TCP socket to send the request to XCom. XCom will resolve this future when it receives and processes the request. When GCS retrieves the future's result, GCS obtains a std::unique_ptr to the Reply. Unless you do any shenanigans with this std::unique_ptr, when it goes out of scope the Reply object is destroyed. The Reply object owns the payload of XCom's reply (pax_msg), so the Reply object destroys the pax_msg when it is destroyed.