-
Notifications
You must be signed in to change notification settings - Fork 314
Implement request cancellation #860
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
Conversation
@swift-ci Please test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
1ff9b9e
to
75dbfd7
Compare
@swift-ci Please test |
75dbfd7
to
4238344
Compare
@swift-ci Please test |
@swift-ci Please test Windows |
1 similar comment
@swift-ci Please test Windows |
This is currently blocked because we open the documents in sourcekitd semantically, not with |
/// cancelled, `cancel` is invoked with the handle that `operation` provided. | ||
public func withCancellableCheckedThrowingContinuation<Handle, Result>( | ||
_ operation: (_ continuation: CheckedContinuation<Result, any Error>) -> Handle, | ||
cancel: (Handle) -> Void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this probably ought to be marked @Sendable
(I believe we'll warn under strict concurrency)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Talking of strict concurrency checking, are we planning on enabling that for this repo? I don't think it's a proper package option yet, but I think you can add .enableExperimentalFeature("StrictConcurrency")
as a build setting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was planning to try and enable strict concurrency checking once I don’t have any further async migrations in my backlog. Until I do that, I don’t think I care about sendable annotations too much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough
a422359
to
d7ade55
Compare
a4d687f
to
9b12ec2
Compare
@swift-ci Please test |
Since we open documents as syntactic-only now, we can support cancellation. 🎉🏎️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥳
@swift-ci Please test Windows |
When receiving a `CancellationNotification`, we cancel the task that handles the request with that ID. This will cause `cancel_notification` to be sent to sourcekitd or a `CancellationNotification` to be sent to `clangd`, which ultimately cancels the request. rdar://117492860
This is no longer needed because we handle cancellation on the `Task` level.
… wouldn't get cancelled
9b12ec2
to
f29c97f
Compare
@swift-ci Please test |
@swift-ci Please test Windows |
1 similar comment
@swift-ci Please test Windows |
When receiving a
CancellationNotification
, we cancel the task that handles the request with that ID.This will cause
cancel_notification
to be sent to sourcekitd or aCancellationNotification
to be sent toclangd
, which ultimately cancels the request.rdar://117492860