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

Show how deadline can be set #313

Merged
merged 1 commit into from
Oct 6, 2018

Conversation

stanley-cheung
Copy link
Collaborator

@stanley-cheung stanley-cheung commented Oct 6, 2018

Show how we can set a deadline header for each RPC. The value should be a Unix timestamp, in milliseconds. The format should be the same as a gRPC Node client.

var deadline = new Date();
deadline.setSeconds(deadline.getSeconds() + 1);

client.sayHelloAfterDelay(request, {deadline: deadline.getTime()},
  (err, response) => {
    // err will be populated if the RPC exceeds the deadline
    ...
  });

@stanley-cheung stanley-cheung merged commit f92ceda into grpc:master Oct 6, 2018
@stanley-cheung stanley-cheung deleted the set-deadline branch October 6, 2018 08:13
loyalpartner pushed a commit to loyalpartner/grpc-web that referenced this pull request Sep 4, 2020
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