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.

Common `Cancelable` interface?

See original GitHub issue

I think it would be an improvement to align Job, Deferred, and Channel under a common Cancelable interface. It doesn’t have to be named that, but I think it should be similar to the RxJava Disposable interface, perhaps having the equivalent of 2 methods, cancel, and isCancelled. Perhaps it would be appropriate to break out the isActive, and isCompleted into their own interfaces as well?

Having a utility class that would be the equivalent of the CompositeDisposable would be convenient as well.

I don’t have a problem submitting a PR myself, I thought it appropriate to discuss this first though.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
qwwdfsadcommented, Nov 6, 2018

Currently, CoroutineScope provides a mechanism for abstracting any computation/scope (whether it is an actor, job or a future), the new interface may add even more confusion, so I’d rather not to introduce it.

0reactions
elizarovcommented, Feb 6, 2018

Bare channel does not. There are produce and actor builders that tie the channel to the job. However, the resulting “channel’s job” is not currently exposed via public api.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uses of Interface java.util.concurrent.Cancellable
interface, ScheduledCancellable. A delayed or periodic action that can be cancelled. ; interface, ScheduledFuture<V>
Read more >
java.util.concurrent Interface Cancellable
Something, usually a task, that can be cancelled. Cancellation is performed by the cancel method. Additional methods are provided to determine if the...
Read more >
Commonly used Java -able Interfaces and Classes
The enumeration of commonly used Java interfaces and classes that ends ... The Undo operation is used to cancel the last applied command....
Read more >
Cancel vs Close: Design to Distinguish the Difference
Distinguishing between close and cancel is critical to avoiding losing users' work.
Read more >
User interface - cancel order screen - IBM
Migration strategy. To configure the cancellation reasons for a specific version of the Sterling Store application, define qualifiers for the common codes.
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