Skip to content

Conversation

@albertli-msft
Copy link
Contributor

@albertli-msft albertli-msft commented Dec 13, 2022

support_light_serverhost_client_Code_Z8w0nkhleI.mp4

Support a light version ServiceHostClient that allow TaskRunner and Debuger reusing it to connect the host.

  • I. Move socket connection logics into a reusable socket client and create bunch of promise helpers.
  • II. Break a light version ServiceHostClient out of original ServiceHostClient
  • III. Create a new PqSdkTaskTerminal, taking ServiceHostClientLight, as the task runner when it connects the servicehost
  • IV. Enhance existing MQueryDebugSession to take ServiceHostClientLight while the extension using the servicehost

}
}

export class CancelToken {
Copy link
Member

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?

Copy link
Contributor Author

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");
Copy link
Member

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?

Copy link
Contributor Author

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. 😬

@albertli-msft albertli-msft changed the title Support ServiceHostClient light version feat. Support ServiceHostClient light version Dec 17, 2022
@albertli-msft albertli-msft merged commit b5cc2b1 into main Dec 19, 2022
@albertli-msft albertli-msft deleted the dev/albertli/reuse-pq-svc-cl branch December 19, 2022 15:03
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.

3 participants