question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provide a way to cancel client request.

See original GitHub issue

We have ClientRequestContext.timeoutNow() to trigger timeout immediately. Similarly, it might be good to add ClientRequestContext.cancel() which cancels the current client request in case a user cannot easily cancel or abort the response such as https://github.com/line/centraldogma/blob/master/client/java/src/main/java/com/linecorp/centraldogma/internal/client/AbstractWatcher.java#L224

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
minwooxcommented, Sep 11, 2020

If ctx is canceled after the request is fully sent (i.e waiting to get a response fully), the response is never canceled. So I think we should use a different approach.

Do you mean it should also use the TimeoutScheduler to schedule the cancellation?

I’m not sure if we can rename TimeoutScheduler to something else and generalize for this purpose (cancel or timeoutNow which just abort the response with the different exception), but it’s worth trying. What I meant was that we should do the same approach as TimeoutScheduler does. (It maintains the state of a request and cancel it if necessary.)

1reaction
minwooxcommented, Sep 10, 2020

Thanks, @tumile for your interest. I think it’s rather going to work exactly as ClientRequestContext.timeoutNow() does except raising CancellationException instead of ResponseTimeoutException. 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Cancel a Meeting Without Upsetting Your Client
Especially if you're the requesting party and need to cancel, it's courteous to apologize. Instead of sending an email or text message, give...
Read more >
How To Cancel A Client Meeting Without Sounding Rude
1. Turn The Meeting Into A Phone Call · 2. Turn The Meeting Into A Shorter Meeting · 3. Turn The Meeting Into...
Read more >
How to Cancel a Meeting Without Upsetting Your Client ... - Indy
Be clear about the reason for the cancellation. Let your client know what happened and why it was necessary. This way, they won't...
Read more >
Here's how successful people cancel meetings, Stanford ...
The right way to 'cancel' · 1. Respond to invitations promptly by clicking “accept,” “decline” or “tentative.” · 2. Notify attendees at least...
Read more >
How to Respond to a Cancellation Requests + Email Templates
Want to save hours of repetitive typing? Try Text Blaze, it's free! Ask why they decided to cancel, how your company can (or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found