Skip to content
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

feat(inspector): send api names along with metainfo (step 1) #5518

Merged
merged 1 commit into from
Feb 20, 2021

Conversation

pavelfeldman
Copy link
Member

No description provided.

@pavelfeldman pavelfeldman changed the title feat(inspector): send api names along with metainfo feat(inspector): send api names along with metainfo (step 1) Feb 19, 2021
@@ -84,11 +84,11 @@ export abstract class ChannelOwner<T extends channels.Channel = channels.Channel
};
}

async _wrapApiCall<T>(apiName: string, func: () => Promise<T>, logger?: Logger): Promise<T> {
async _wrapApiCall<T, K extends channels.Channel>(apiName: string, func: (channel: K) => Promise<T>, logger?: Logger): Promise<T> {
Copy link
Contributor

Choose a reason for hiding this comment

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

async _wrapApiCall<R>(apiName: string, func: (channel: T) => Promise<R>, logger?: Logger): Promise<R> {

I believe this should infer the channel type from ChannelOwner<T> and you would not have to write channel: channels.FooChannel everywhere.

logger = logger || this._logger;
try {
logApiCall(logger, `=> ${apiName} started`);
const result = await func();
const result = await func(this._channel as any);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we make this._channel private so that we always wrap with some api name?

@pavelfeldman pavelfeldman merged commit f154a82 into microsoft:master Feb 20, 2021
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