Skip to content

Commit

Permalink
fix(network/flow): consider responses
Browse files Browse the repository at this point in the history
  • Loading branch information
loyd committed Sep 26, 2023
1 parent 0cb5b3e commit 315770a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions elfo-network/src/worker/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,16 @@ impl SocketReader {
let trace_id = network_envelope.trace_id;
let recipient = network_envelope.recipient;

// Adjust RX flow.
{
let mut flows = self.rx_flows.lock();
if let Some(mut flow) = flows.get_flow(recipient) {
flow.acquire_direct(true);
// Responds are unbounded, so release immediately.
self.send_back(flow.release_direct());
}
}

let Some(token) = self
.requests
.lock()
Expand Down Expand Up @@ -522,6 +532,7 @@ impl SocketReader {
// Since this is a response to a request which originated from this node,
// all the neccessary flows have been already added.
object.respond(token, envelope);

return None;
}
};
Expand Down

0 comments on commit 315770a

Please sign in to comment.