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

Dispatch messages in dedicated thread #298

Merged
merged 1 commit into from
Mar 7, 2023

Conversation

acogoluegnes
Copy link
Contributor

Each connection has now a dedicated single-threaded executor to dispatch messages. This is especially suited
for long consumers, as they could block the handling of other frames sent by the server.

Other server frames are now handled by a shared executor service. The default implementation maintains a list of executor services shared between all connections maintained by the environment instances. The list grows and shrinks depending on the usage.

Each connection has now a dedicated single-threaded executor
to dispatch messages. This is especially suited
for long consumers, as they could block the handling of
other frames sent by the server.

Other server frames are now handled by a shared executor service.
The default implementation maintains a list of executor services
shared between all connections maintained by the environment instances.
The list grows and shrinks depending on the usage.
@acogoluegnes acogoluegnes added this to the 0.10.0 milestone Mar 7, 2023
@acogoluegnes acogoluegnes merged commit aaf196e into main Mar 7, 2023
@acogoluegnes acogoluegnes deleted the dispatch-messages-in-dedicated-thread branch March 7, 2023 14:20
acogoluegnes added a commit that referenced this pull request Mar 7, 2023
Executor services are now shared between connection, but
there must be a distinction between producer and consumer
connections, as a consumer can depend on a RPC in
a producer connection (e.g. getting the stored offset
from a connection to the stream leader). So the producer
and consumer connections cannot share the same executors
to avoid deadlocks.

References #298
github-actions bot pushed a commit that referenced this pull request Mar 7, 2023
Executor services are now shared between connection, but
there must be a distinction between producer and consumer
connections, as a consumer can depend on a RPC in
a producer connection (e.g. getting the stored offset
from a connection to the stream leader). So the producer
and consumer connections cannot share the same executors
to avoid deadlocks.

References #298
acogoluegnes added a commit that referenced this pull request Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant