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

Alllow calls to run on a specified event loop #1156

Merged
merged 1 commit into from
Apr 7, 2021

Conversation

glbrntt
Copy link
Collaborator

@glbrntt glbrntt commented Apr 6, 2021

Motivation:

It can be helpful for callers to know which event loop their RPCs are
completed on. Currently the caller must hop to the desired event loop if
it differs from the event loop used by the underlying transport. This
can be tedious and error prone since it must be done in a number of
places.

Modifications:

  • Separate the event loop an RPC runs on (i.e. the one used for
    interceptors and response futures) and the event loop the RPC is
    transported on (i.e. the one used by the underlying 'Channel').
  • Add an 'EventLoopPreference' to 'CallOptions' allowing users to
    specify they are 'indifferent' (the existing and default behaviour,
    use an event loop provided by the framework) or use an 'exact' event
    loop.
  • Add tests.

Result:

Callers can specify an event loop to run their RPCs on.

@glbrntt glbrntt added the 🆕 semver/minor Adds new public API. label Apr 6, 2021
@glbrntt glbrntt requested a review from Lukasa April 6, 2021 12:16
Motivation:

It can be helpful for callers to know which event loop their RPCs are
completed on. Currently the caller must hop to the desired event loop if
it differs from the event loop used by the underlying transport. This
can be tedious and error prone since it must be done in a number of
places.

Modifications:

- Separate the event loop an RPC runs on (i.e. the one used for
  interceptors and response futures) and the event loop the RPC is
  transported on (i.e. the one used by the underlying 'Channel').
- Add an 'EventLoopPreference' to 'CallOptions' allowing users to
  specify they are 'indifferent' (the existing and default behaviour,
  use an event loop provided by the framework) or use an 'exact' event
  loop.
- Add tests.

Result:

Callers can specify an event loop to run their RPCs on.
Copy link
Collaborator

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

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

Nice, this LGTM.

@glbrntt glbrntt merged commit 25f6cda into grpc:main Apr 7, 2021
@glbrntt glbrntt deleted the gb-different-el branch April 7, 2021 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🆕 semver/minor Adds new public API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants