Skip to content

feat: improve cross resolving context - #2

Open
FME849 wants to merge 2 commits into
mainfrom
FME849/improve-cross-resolving-context
Open

feat: improve cross resolving context#2
FME849 wants to merge 2 commits into
mainfrom
FME849/improve-cross-resolving-context

Conversation

@FME849

@FME849 FME849 commented Jun 13, 2024

Copy link
Copy Markdown
Collaborator
  • Including the origin sender in the payload
  • Enable manually handle cross-resolving context

Comment thread src/core/kernel.ts
requestId: string;
resolve: (value: unknown) => void;
reject: (error: Error | string) => void;
resolveCallback?: Middleware;

Copy link
Copy Markdown
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

Comment thread src/core/kernel.ts
respond({ message: 'ok' });
} else {
await resolveCallback(request, respond, resolve);
}

@tanlethanh tanlethanh Jun 14, 2024

Copy link
Copy Markdown
Member

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

@tanlethanh tanlethanh Jun 14, 2024

Copy link
Copy Markdown
Member

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