Handle tracked requests. More...
#include <inflight_requests.h>
Public Member Functions | |
InflightRequests ()=default | |
Default constructor. | |
InflightRequests (const InflightRequests &)=delete | |
InflightRequests & | operator= (InflightRequests const &)=delete |
InflightRequests (InflightRequests &&o)=delete | |
InflightRequests & | operator= (InflightRequests &&o)=delete |
~InflightRequests () | |
Destructor. More... | |
size_t | size () |
Query the number of pending inflight requests. More... | |
void | insert (std::shared_ptr< Request > request) |
Insert an inflight requests to the container. More... | |
void | merge (TrackedRequestsPtr trackedRequests) |
Merge containers of inflight requests with the internal containers. More... | |
void | remove (const Request *const request) |
Remove an inflight request from the internal container. More... | |
size_t | cancelAll () |
Issue cancelation of all inflight requests and clear the internal container. More... | |
TrackedRequestsPtr | release () |
Releases the internally-tracked containers. More... | |
size_t | getCancelingSize () |
Get count of requests in process of cancelation. More... | |
Handle tracked requests.
Handle tracked requests, providing functionality so that its owner can modify those requests, performing operations such as insertion, removal and cancelation.
ucxx::InflightRequests::~InflightRequests | ( | ) |
Destructor.
Cancels all inflight requests before destruction.
size_t ucxx::InflightRequests::cancelAll | ( | ) |
Issue cancelation of all inflight requests and clear the internal container.
Issue cancelation of all inflight requests known to this object and clear the internal container. The total number of canceled requests is returned.
size_t ucxx::InflightRequests::getCancelingSize | ( | ) |
Get count of requests in process of cancelation.
After cancelAll()
is called the requests are scheduled for cancelation but may not complete immediately, therefore they are tracked until cancelation is completed. This method returns the count of requests in process of cancelation and drops references to those that have completed.
void ucxx::InflightRequests::insert | ( | std::shared_ptr< Request > | request | ) |
Insert an inflight requests to the container.
[in] | request | a std::shared_ptr<Request> with the inflight request. |
void ucxx::InflightRequests::merge | ( | TrackedRequestsPtr | trackedRequests | ) |
Merge containers of inflight requests with the internal containers.
Merge containers of inflight requests obtained from InflightRequests::release()
of another object with the internal containers.
[in] | trackedRequests | containers of tracked inflight requests to merge with the internal tracked inflight requests. |
TrackedRequestsPtr ucxx::InflightRequests::release | ( | ) |
Releases the internally-tracked containers.
Releases the internally-tracked containers that can be merged into another InflightRequests
object with InflightRequests::merge()
. Effectively leaves the internal state as a clean, new object.
void ucxx::InflightRequests::remove | ( | const Request *const | request | ) |
Remove an inflight request from the internal container.
Remove the reference to a specific request from the internal container. This should be called when a request has completed and the InflightRequests
owner does not need to keep track of it anymore. The raw pointer to a ucxx::Request
is passed here as opposed to the usual std::shared_ptr<ucxx::Request>
used elsewhere, this is because the raw pointer address is used as key to the requests reference, and this is called called from the object's destructor.
[in] | request | raw pointer to the request |
size_t ucxx::InflightRequests::size | ( | ) |
Query the number of pending inflight requests.