Skip to content

CancellableContinuation should not be a Job #219

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

Closed
elizarov opened this issue Feb 5, 2018 · 0 comments
Closed

CancellableContinuation should not be a Job #219

elizarov opened this issue Feb 5, 2018 · 0 comments

Comments

@elizarov
Copy link
Contributor

elizarov commented Feb 5, 2018

CancellableContinuation interface should cease to extend Job interface. Job is too "heavy weight". Job has a concept of "children" and "completing" state where it waits for its children to complete. None of that is applicable to CancellableContinuation. It has much simpler state-machine. Thus, Job has many methods and extensions that are not truly applicable to CancellableContinuation.

From implementation standpoint, CancellableContinuation has to extend JobSupport for all that Job machinery which is not needed. This complicates the code itself and makes it harder to performance-optimize CancellableContinuation to its specific use-cases.

CancellableContinuation will still keep many methods from the Job, notably invokeOnCompletion, cancel and isActive/isCompleted/isCancelled.

@elizarov elizarov changed the title CancelleableContinuation should not be a Job CancellableContinuation should not be a Job Feb 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant