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: improve cross resolving context #2

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

FME849
Copy link
Collaborator

@FME849 FME849 commented Jun 13, 2024

  • Including the origin sender in the payload
  • Enable manually handle cross-resolving context

@@ -28,6 +28,7 @@ export class Kernel<
requestId: string;
resolve: (value: unknown) => void;
reject: (error: Error | string) => void;
resolveCallback?: Middleware;
Copy link
Member

Choose a reason for hiding this comment

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

please add a document for this param

respond({ message: 'ok' });
} else {
await resolveCallback(request, respond, resolve);
}
Copy link
Member

@tanlethanh tanlethanh Jun 14, 2024

Choose a reason for hiding this comment

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

you should add an unit test for this one

Copy link
Member

@tanlethanh tanlethanh Jun 14, 2024

Choose a reason for hiding this comment

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

also, how about auto repond respond({ message: 'ok' }); after await resolveCallback(request, respond, resolve);. That means the resolveCallback is used to proxy the request to check for resolving only, don't need to care about respond to resolver. And the callback middleware itself only throws Error if the resolving request is not accepted

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