fix(http): drain SSE stream for connection reuse (#790)
* fix(http): reduce latency on subsequent StreamableHttp calls * refactor: rely on stream drain for connection reuse * refactor: clean up comments and naming * fix: restore pool_max_idle_per_host(0) for Linux
This commit is contained in:
parent
ad3997268d
commit
c99903a67a
1 changed files with 210 additions and 69 deletions
|
|
@ -470,7 +470,7 @@ impl LocalSessionWorker {
|
|||
{
|
||||
OutboundChannel::RequestWise {
|
||||
id: *id,
|
||||
close: false,
|
||||
close: true,
|
||||
}
|
||||
} else {
|
||||
OutboundChannel::Common
|
||||
|
|
@ -483,7 +483,7 @@ impl LocalSessionWorker {
|
|||
{
|
||||
OutboundChannel::RequestWise {
|
||||
id: *id,
|
||||
close: false,
|
||||
close: true,
|
||||
}
|
||||
} else {
|
||||
OutboundChannel::Common
|
||||
|
|
@ -501,7 +501,11 @@ impl LocalSessionWorker {
|
|||
if let Some(request_wise) = self.tx_router.get_mut(&id) {
|
||||
request_wise.tx.send(message).await;
|
||||
if close {
|
||||
self.tx_router.remove(&id);
|
||||
if let Some(channel) = self.tx_router.remove(&id) {
|
||||
for resource in channel.resources {
|
||||
self.resource_router.remove(&resource);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return Err(SessionError::ChannelClosed(Some(id)));
|
||||
|
|
|
|||
Loading…
Reference in a new issue