-
Notifications
You must be signed in to change notification settings - Fork 18
feat. Support ServiceHostClient light version #207
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
…ServiceHostClient
….ts out of PqServiceHostClient.ts
…ts as the task runner implementation
…erviceHostClientLight
src/common/promises/CancelToken.ts
Outdated
| } | ||
| } | ||
|
|
||
| export class CancelToken { |
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.
A more standard term seems to be CancellationToken, but I don't feel strongly about this.
Are there existing cancellation interfaces in the vscode APIs? Would it make sense to use them here?
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.
rename CancelToken into CancellationToken;
rename CancelSource into CancellationTokenSource;
and also implement vsc's CancellationToken for future integration.
I was thinking, we gonna have to adapt nodejs abort onAbort signal, or even other cancellation token from its source, like vsc cancellation tokens.
Thus, I was thinking it would be safer to have our own cancellation implementation as a buffer layer where we could combine or adapt to any when we needed. 😬
| * LICENSE file in the root of this projects source tree. | ||
| */ | ||
|
|
||
| export const $$toStringTag: symbol = Symbol("toStringTag"); |
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.
Could you explain what this is doing?
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.
Yes, the symbol can guarantee there would be only one single reference of the symbol value at the runtime.
And we could use the symbol as the index key to return a cancelTokenTag string, that tag string could be used to tell us whether one cancellation token instance is one of us customized cancel token instance or not.
By using the symbol key, we would avoid naming collision, there won't any risks of other types of cancellation tokens carrying similar tags and confused us. 😬
support_light_serverhost_client_Code_Z8w0nkhleI.mp4
Support a light version ServiceHostClient that allow TaskRunner and Debuger reusing it to connect the host.