change stream to use backpressure (#4654)

This commit is contained in:
Shreyansh 2022-08-24 02:24:15 +05:30 committed by GitHub
parent 288918d705
commit 4e4e4aa9ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -376,8 +376,9 @@ case class PeerManager(
}
private val dataMessageStreamSource = Source
.queue[StreamDataMessageWrapper](10000,
overflowStrategy = OverflowStrategy.fail)
.queue[StreamDataMessageWrapper](1500,
overflowStrategy =
OverflowStrategy.backpressure)
.mapAsync(1) {
case msg @ DataMessageWrapper(payload, peerMsgSender, peer) =>
logger.debug(s"Got ${payload.commandName} from ${peer} in stream")