Skip to content

Generate deadline per call from single configuration #4305

@richardstartin

Description

@richardstartin

What version of gRPC are you using?

1.9.0

What did you expect to see?

The ability to specify a desired timeout per stub and have a deadline generated from the specified timeout per RPC.

Unless I'm missing something, the only way to effectively specify a (relative) timeout is to use (absolute) deadlines repetitively as follows:

MyServiceStub stub = newBlockingStub(channel);
stub.withDeadline(Deadline.after(100, TimeUnit.MICROSECONDS)).foo(request);

This means I need to write .withDeadlineAfter(100, TimeUnit.MICROSECONDS) or similar on every call site. It would be nice to be able to specify a timeout or deadline generation specification on the stub since I consider it a cross cutting concern.

MyServiceStub stub = newBlockingStub(channel).withDeadlineSpecification(100, TimeUnit.MICROSECONDS);
...
stub.foo(request);

Where a Deadline equal to Deadline.after(100, TimeUnit.MICROSECONDS) has been set on the CallOptions before each call.

Is it otherwise possible to specify a relative cutoff?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions