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

Support binding gRPC services that are defined as object literals. #164

Merged
merged 1 commit into from
Sep 15, 2023
Merged

Support binding gRPC services that are defined as object literals. #164

merged 1 commit into from
Sep 15, 2023

Conversation

igalshilman
Copy link
Contributor

@igalshilman igalshilman commented Sep 14, 2023

This PR adds an additional way of binding gRPC services.

Here are few examples:

const greeter = {
  greet: (req) => TestResponse.create({ greeting: `Hello` })
};

or the fully typed variant:

const greeter: GreeterService = {
  greet:  async (req: GreetRequest): Promise<GreetResponse> => {
    return TestResponse.create({ greeting: `Hello` });
  },
};

This commit allows binding gRPC services directly, in the following way:

const greeter = {
  greet: (req) => TestResponse.create({ greeting: `Hello` })
};
@igalshilman igalshilman merged commit 08458c0 into restatedev:main Sep 15, 2023
3 checks passed
@igalshilman igalshilman removed the request for review from StephanEwen September 15, 2023 15:15
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.

1 participant