-
Notifications
You must be signed in to change notification settings - Fork 93
Open
Labels
Milestone
Description
The current service invocation API is confusing. For example, the GRPC invocation requires a HTTP verb to be passed.
From https://github.com/dapr/js-sdk/blob/master/test/e2e/main.grpc.test.ts
it('should be able to listen and invoke a service with GET', async () => {
const mock = jest.fn(async (_data: object) => ({ hello: 'world' }));
await server.invoker.listen('hello-world', mock, { method: HttpMethod.GET });
const res = await client.invoker.invoke(daprAppId, 'hello-world', HttpMethod.GET);
// Delay a bit for event to arrive
// await new Promise((resolve, reject) => setTimeout(resolve, 250));
expect(mock.mock.calls.length).toBe(1);
expect(JSON.stringify(res)).toEqual(`{"hello":"world"}`);
});
This issue is to fix the interfaces and relevant implementations. Also update examples to show the same.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Assigned