-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: main
Are you sure you want to change the base?
Conversation
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; |
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.
please add a document for this param
respond({ message: 'ok' }); | ||
} else { | ||
await resolveCallback(request, respond, resolve); | ||
} |
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.
you should add an unit test for this one
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.
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