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

Implement a NIOAsyncWriter #2251

Merged
merged 13 commits into from
Sep 21, 2022
Merged

Implement a NIOAsyncWriter #2251

merged 13 commits into from
Sep 21, 2022

Commits on Sep 20, 2022

  1. Implement a NIOAsyncWriter

    # Motivation
    We previously added the `NIOAsyncProducer` to bridge between the NIO channel pipeline and the asynchronous world. However, we still need something to bridge writes from the asynchronous world back to the NIO channel pipeline.
    
    # Modification
    This PR adds a new `NIOAsyncWriter` type that allows us to asynchronously `yield` elements to it. On the other side, we can register a `NIOAsyncWriterDelegate` which will get informed about any written elements. Furthermore, the synchronous side can toggle the writability of the `AsyncWriter` which allows it to implement flow control.
    A main goal of this type is to be as performant as possible. To achieve this I did the following things:
    - Make everything generic and inlinable
    - Use a class with a lock instead of an actor
    - Provide methods to yield a sequence of things which allows users to reduce the amount of times the lock gets acquired.
    
    # Result
    We now have the means to bridge writes from the asynchronous world to the synchronous
    FranzBusch committed Sep 20, 2022
    Configuration menu
    Copy the full SHA
    bf469b1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3d22230 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d64143d View commit details
    Browse the repository at this point in the history
  4. More code review comments

    FranzBusch committed Sep 20, 2022
    Configuration menu
    Copy the full SHA
    eed945a View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    b66a70c View commit details
    Browse the repository at this point in the history
  6. Comment fixups

    FranzBusch committed Sep 20, 2022
    Configuration menu
    Copy the full SHA
    07f2faf View commit details
    Browse the repository at this point in the history
  7. More doc fixes

    FranzBusch committed Sep 20, 2022
    Configuration menu
    Copy the full SHA
    64ec5cc View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    bef958c View commit details
    Browse the repository at this point in the history
  9. Refactor the writer to only yield Deques and rename the delegate to N…

    …IOAsyncWriterSinkDelegate
    FranzBusch committed Sep 20, 2022
    Configuration menu
    Copy the full SHA
    031cff3 View commit details
    Browse the repository at this point in the history
  10. Review

    FranzBusch committed Sep 20, 2022
    Configuration menu
    Copy the full SHA
    7d3e7fa View commit details
    Browse the repository at this point in the history
  11. Fix some warnings

    FranzBusch committed Sep 20, 2022
    Configuration menu
    Copy the full SHA
    90f2b39 View commit details
    Browse the repository at this point in the history
  12. Fix benchmark sendability

    FranzBusch committed Sep 20, 2022
    Configuration menu
    Copy the full SHA
    7aeeaa5 View commit details
    Browse the repository at this point in the history

Commits on Sep 21, 2022

  1. Configuration menu
    Copy the full SHA
    627db1a View commit details
    Browse the repository at this point in the history