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

When Using a Proactor Allow Async Transport Calls Where Supported #3418

Open
iancooper opened this issue Dec 11, 2024 · 0 comments
Open

When Using a Proactor Allow Async Transport Calls Where Supported #3418

iancooper opened this issue Dec 11, 2024 · 0 comments
Assignees
Labels
2 - In Progress Breaking Change .NET Pull requests that update .net code v10 Allocal to a v10 release

Comments

@iancooper
Copy link
Member

iancooper commented Dec 11, 2024

Is your feature request related to a problem? Please describe.
Brighter supports two models for concurrency: Reactor and Proactor. Both are single-threaded message pumps, but the Proactor uses asynchronous I/O. Theoretically the Reactor has better performance and the Proactor has better throughput.

In V9, the Proactor only assumes that user-defined code, in handlers or transformers will use asynchronous I/O, not any transports.

Transports are mixed in their support for sync and async APIs, some support both, some one or the other.

Describe the solution you'd like
In V10, have the Proactor assume that we have an asynchronous transport, not a synchronous one. Where the transport is natively async this will result in better throughput. Where the transport is not asynchronous, our synchronization context will prevent deadlocks.

This will require the addition of asychronous versions of IAmAChannel, IAmAMessageConsumer, and IAmAChannelFactory and their implementations.

Describe alternatives you've considered
We could continue to use a tactic of blocking on asynchronous transports to force them to be synchronous. This is less risky for us, due to our usage of a single-threaded pump that processes messages sequentially. But, this doesn't allow users who have chosen the model

Additional context
As these changes would be breaking, we need to make the choice to make them with V10, otherwise we will end up deferring them again to V11. We may also have context that most people believe that our transport calls are asynchronous in V9, when they use the isAsync flag on their declaration.

@iancooper iancooper added 2 - In Progress Breaking Change v10 Allocal to a v10 release .NET Pull requests that update .net code labels Dec 11, 2024
@iancooper iancooper self-assigned this Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 - In Progress Breaking Change .NET Pull requests that update .net code v10 Allocal to a v10 release
Projects
None yet
Development

No branches or pull requests

1 participant