The Response and the ACK are unorganized in terms of what comes first when to communicate an ACK should be polled, and when to ignore.
This leads to a problem while using a channel, if we send a fire and forget message (which we'll not poll ack), and then send a send_waiton_ack (which will poll the ack) it will poll the wrong ack, since channels are a queue.
To solve this issue, I've introduced a new AwaitMap data structure. On one end, we can insert and on the other end, we can get the inserted data. If we're getting and the data is not available, the task will wait until the data is available, similar to mpsc::Recieve or any other async channel.
Send the events will remain on the channel, as events are expected to be ordered the same way we received them.
Other notes
send_request now returns the request's transaction, so we know what to poll.
Improvements
[x] Introduce expiry on entries or map size, so we can contain the unbounded growth of the maps and minimize the transaction conflicts.
Description
The Response and the ACK are unorganized in terms of what comes first when to communicate an ACK should be polled, and when to ignore. This leads to a problem while using a channel, if we send a fire and forget message (which we'll not poll ack), and then send a
send_waiton_ack
(which will poll the ack) it will poll the wrong ack, since channels are a queue.To solve this issue, I've introduced a new
AwaitMap
data structure. On one end, we can insert and on the other end, we can get the inserted data. If we're getting and the data is not available, the task will wait until the data is available, similar tompsc::Recieve
or any other async channel.Send the events will remain on the channel, as events are expected to be ordered the same way we received them.
Other notes
send_request
now returns the request's transaction, so we know what to poll.Improvements
NapMap