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.

discussion: cancellation of actions

See original GitHub issue

Right now actions cannot be cancelled - once called they’re expected to either finish executing or return an error. Sometimes when one piece of a chain halts, there’s no point in continuing the other, already started pieces. This is part of the design in pull-stream. At this point choo’s actions have no concept of cancellation, so I’d like to start a bit of discussion about this:

  • do we need a cancellation mechanism between actions?
  • what are the use cases for cancellation?
  • what prior art is there around this?
  • (how) do the browser protocols handle cancellations (HTTP / WS / SSE / WebRTC)?

This is probably for more advanced use cases; but giving it some thought would definitely be worth it I reckon. Thanks!

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
yoshuawuytscommented, Oct 8, 2016

I’ve been wondering about this a bit more lately. Do we truly need cancellation? Something we should ask ourselves is what use case it would support.

The way I’m viewing actions now is as immutable commands that either ACK or NACK - they’re a bit expensive to send but that’s cool. Because they’re expensive to send, they shouldn’t be used to stream data from. When streaming data it’d be recommended to buffer instead (even tiny buffers) rather than send a flood of actions. Because of this, it doesn’t make sense to also have cancellation in there.

As a tl:dr; cancellation adds technical cost, can’t really think of a scenario where I’d use it and send() is not great for streaming anyway

1reaction
yoshuawuytscommented, Jul 20, 2016

Ah right, from discussion on IRC with @toddself and @timwis we decided it’s probs not wise to move to pull-stream because the default experience for choo would be… not great.

Instead what we might do is supporting cancellation in the existing API by (wait for it) adding yet another callback! 🎉 - but this one would be totes optional, and we’d like never use it in any of the examples. It’s only there so that if someone wants to upgrade to an async flow that supports cancellation it’s possible. Wouldn’t that be sweet? 😁

So yeah, minor patch possible for this I reckon - keeps the upgrade flow nice and smooth 🆒

Read more comments on GitHub >

github_iconTop Results From Across the Web

Meeting Cancellation Emails: How to Write One [+Examples]
Learn how to reschedule meetings ASAP if you have a scheduling conflict or if you're feeling sick. Plus, see examples.
Read more >
How to Have the Termination Discussion - SHRM
Termination meetings are always challenging. Minutes before you call the employee into your office, your heart pounds; you experience mixed ...
Read more >
How to Write a Polite Meeting Cancellation Email
1. It is better to dedicate some time and write it yourself, or at least from your own email address. 2. When terminating...
Read more >
What is cancel culture? Why we keep fighting about ... - Vox
Within the turbulent past few years, the idea that a person can be “canceled” — in other words, culturally blocked from having a...
Read more >
What Is Cancel Culture, and Does It Change Things for the ...
Four students engaging in a class discussion ... Use these lesson activities to help your students think deeply about the impact of cancel...
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