Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Make isComplete reflect result availability #178

Merged
merged 2 commits into from
May 11, 2021

Conversation

natebosch
Copy link
Contributor

Fixes dart-lang/core#341

Change the CancelableOperation.isComplete to forward to the _inner
completer, which is not completed until the result is available unlike
CancelableOperation.isComplete which may lead the result when
complete is called with a Future argument. Update the docs to
reflect the new behavior. Keep the detail about this property indicating
whether the operation can still be canceled. This detail was incorrectly
stated before, but matches the new implementation.

Remove details pointing to CancelableCompleter from the
CancelableOperation docs. Flesh out the docs on the completer so that
the distinction between the two isComplete getters is more clear.

Remove a detail about not returning null from the cancel() doc since
the non-nullable return type already makes this clear.

Fixes #176

Change the `CancelableOperation.isComplete` to forward to the `_inner`
completer, which is not completed until the result is available unlike
`CancelableOperation.isComplete` which may lead the result when
`complete` is called with a `Future` argument. Update the docs to
reflect the new behavior. Keep the detail about this property indicating
whether the operation can still be canceled. This detail was incorrectly
stated before, but matches the new implementation.

Remove details pointing to `CancelableCompleter` from the
`CancelableOperation` docs. Flesh out the docs on the completer so that
the distinction between the two `isComplete` getters is more clear.

Remove a detail about not returning `null` from the `cancel()` doc since
the non-nullable return type already makes this clear.
@natebosch natebosch requested a review from lrhn May 8, 2021 00:01
@google-cla google-cla bot added the cla: yes label May 8, 2021
lib/src/cancelable_operation.dart Outdated Show resolved Hide resolved
lib/src/cancelable_operation.dart Outdated Show resolved Hide resolved
lib/src/cancelable_operation.dart Outdated Show resolved Hide resolved
lib/src/cancelable_operation.dart Outdated Show resolved Hide resolved
lib/src/cancelable_operation.dart Outdated Show resolved Hide resolved
lib/src/cancelable_operation.dart Outdated Show resolved Hide resolved
lib/src/cancelable_operation.dart Outdated Show resolved Hide resolved
lib/src/cancelable_operation.dart Outdated Show resolved Hide resolved
@natebosch natebosch merged commit b9dcd78 into master May 11, 2021
@natebosch natebosch deleted the cancelable-is-completed-later branch May 11, 2021 23:50
mosuem pushed a commit to dart-lang/core that referenced this pull request Oct 14, 2024
Fixes dart-lang/async#176

Change the `CancelableOperation.isComplete` to forward to the `_inner`
completer, which is not completed until the result is available unlike
`CancelableOperation.isComplete` which may lead the result when
`complete` is called with a `Future` argument. Update the docs to
reflect the new behavior. Keep the detail about this property indicating
whether the operation can still be canceled. This detail was incorrectly
stated before, but matches the new implementation.

Remove details pointing to `CancelableCompleter` from the
`CancelableOperation` docs. Flesh out the docs on the completer so that
the distinction between the two `isComplete` getters is more clear.

Remove a detail about not returning `null` from the `cancel()` doc since
the non-nullable return type already makes this clear.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging this pull request may close these issues.

CancelableOperation.isCompleted docs are incorrect
2 participants