Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update backpressure #231

Closed
wants to merge 35 commits into from
Closed

update backpressure #231

wants to merge 35 commits into from

Conversation

MacOMNI
Copy link
Contributor

@MacOMNI MacOMNI commented Nov 25, 2024

No description provided.

@MacOMNI MacOMNI marked this pull request as ready for review November 25, 2024 06:31
Networking/Sources/Networking/Stream.swift Outdated Show resolved Hide resolved
Networking/Sources/Networking/Stream.swift Outdated Show resolved Hide resolved
Copy link

codecov bot commented Dec 3, 2024

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@@ -126,7 +129,63 @@ final class Stream<Handler: StreamHandler>: Sendable, StreamProtocol {
}
if !channel.syncSend(data) {
logger.warning("stream \(id) is full")
// TODO: backpressure handling
receiveData.write { receiveData in
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the receive order can still be wrong (and need some tests to verify this case:

  • receive data1, unable to send to append to receivedData
  • receive data2, actually able to send, and sent it
  • after sleep, sending data1

now the receiver received data2, and data1, which is wrong

@MacOMNI MacOMNI closed this Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants