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

支持脱离 IDL 的开发模式 #345

Open
chickenlj opened this issue Aug 10, 2023 · 0 comments
Open

支持脱离 IDL 的开发模式 #345

chickenlj opened this issue Aug 10, 2023 · 0 comments

Comments

@chickenlj
Copy link
Contributor

image

除了以上api之外,我们可以考虑引入新的api,让用户把service、method、arguments(json)直接输入进来,发起调用,比如,举个例子:

对于IDL生成的ExampleService

export const ExampleService = {
  typeName: "apache.dubbo.demo.example.v1.ExampleService",
  methods: {
    /**
     * @generated from rpc apache.dubbo.demo.example.v1.ExampleService.Say
     */
    say: {
      name: "Say",
      I: SayRequest,
      O: SayResponse,
      kind: MethodKind.Unary,
    },
  }
} as const;

我们可以引入 API
const client = createGenericPromiseClient(transport);
client.call("apache.dubbo.demo.example.v1.ExampleService", "say", {sentence:hello})

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

No branches or pull requests

1 participant