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

Allow timeouts to be rounded so they may comply with the spec #569

Merged
merged 2 commits into from
Aug 28, 2019

Conversation

glbrntt
Copy link
Collaborator

@glbrntt glbrntt commented Aug 28, 2019

Motivation:

The gRPC spec dictates that timeouts may be no longer than 8 digits
long. As such methods for creating GRPCTimeouts all throw if the given
timeout is not valid. In the vast majority of cases this is not actually
an issue and having to handle the exception can be a pain.

Modifications:

Add non-throwing factory methods to GRPCTimeout which round the
timeout so that it may be encoded over the wire.

Result:

Timeouts are easier to create.

Motivation:

The gRPC spec dictates that timeouts may be no longer than 8 digits
long. As such methods for creating `GRPCTimeout`s all throw if the given
timeout is not valid. In the vast majority of cases this is not actually
an issue and having to handle the exception can be a pain.

Modifications:

Add non-throwing factory methods to `GRPCTimeout` which round the
timeout so that it may be encoded over the wire.

Result:

Timeouts are easier to create.
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Aug 28, 2019

CLA Check
The committers are authorized under a signed CLA.

Copy link
Collaborator

@MrMage MrMage left a comment

Choose a reason for hiding this comment

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

Nice!

Package.resolved Outdated Show resolved Hide resolved
@glbrntt glbrntt merged commit 113c247 into grpc:nio Aug 28, 2019
@glbrntt glbrntt deleted the gb-rounded-timeout branch August 28, 2019 11:56
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