Skip to content

Conversation

@lewinpauli
Copy link

@lewinpauli lewinpauli commented Dec 3, 2025

As needed since 6 years here is cancellation support #181

  • Add CancellationToken class for operation cancellation
  • Add CancelledException for cancelled operations
  • Integrate cancellation into BaseOptions, QueryOptions, MutationOptions
  • Implement cancellation handling in QueryManager
  • Add queryCancellable() and mutateCancellable() convenience methods
  • Add comprehensive test suite (7 tests)
  • Add usage documentation

-> no breaking changes

-> all tests pass

- Add CancellationToken class for operation cancellation
- Add CancelledException for cancelled operations
- Integrate cancellation into BaseOptions, QueryOptions, MutationOptions
- Implement cancellation handling in QueryManager
- Add queryCancellable() and mutateCancellable() convenience methods
- Add comprehensive test suite (7 tests)
- Add usage documentation

3. **Error Handling**: Cancelled operations will complete with an `OperationException` containing a `CancelledException` as the `linkException`.

4. **Network Cleanup**: Cancelling an operation will attempt to cancel the underlying network request, but depending on the transport layer and server, the request may still complete on the server side.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't really see how it cancels the underlying request? can you explain?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants