1234567891011121314151617181920212223242526 |
- type EchoServer impl(echo::#Service) {
- verbose: Bool
- };
- method EchoServer.echo: rpc::Method[echo::#Request, echo::#Response]
- &(this) => &(req) =>
- if this.verbose:
- { return { |echo::#Response| {
- content: { "Reply: ?" req.content }
- } } },
- else:
- { return { |echo::#Response| {
- content: req.content
- } } };
- entry
- { rpc::serve {
- service: echo::#Service,
- backend: echo::DefaultServerBackend,
- options: {},
- constructor: &(arg,_) =>
- { return { |echo::#Service| { |EchoServer| {
- verbose: arg.verbose
- } } } }
- } }
- . { crash-on-error };
|