Skip to content

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!

@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