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

Async server implementation #27

Merged
merged 2 commits into from
Jul 22, 2023
Merged

Conversation

tmcgilchrist
Copy link
Collaborator

@tmcgilchrist tmcgilchrist commented May 3, 2023

The implementation is available with this commit 2b13b10

It provides a minimal working version of server.ml for Async using Pipes with a greeter example server for testing. However if needs further testing of the other RPC types by implementing the route guide server and testing on real world examples.

This is on top of #25.

@quernd
Copy link
Collaborator

quernd commented May 13, 2023

Wow, you’re on fire! Thank you for this contribution.
I don’t have enough experience with Async unfortunately. Would you be willing to take a look @mbacarella ?

@tmcgilchrist
Copy link
Collaborator Author

tmcgilchrist commented May 13, 2023 via email

@tmcgilchrist tmcgilchrist force-pushed the async_server branch 4 times, most recently from b167198 to 20d11f1 Compare July 3, 2023 01:09
@tmcgilchrist
Copy link
Collaborator Author

I am happier with this version @mbacarella. The types in server.mli are more obviously correct now:

  type unary = string -> (Grpc.Status.t * string option) Deferred.t
  (** [unary] is the type for a unary grpc rpc, one request, one response. *)

  type client_streaming =
    string Pipe.Reader.t -> (Grpc.Status.t * string option) Deferred.t
  (** [client_streaming] is the type for an rpc where the client streams the requests and the server responds once. *)

  type server_streaming =
    string -> string Pipe.Writer.t -> Grpc.Status.t Deferred.t
  (** [server_streaming] is the type for an rpc where the client sends one request and the server sends multiple responses. *)

  type bidirectional_streaming =
    string Pipe.Reader.t -> string Pipe.Writer.t -> Grpc.Status.t Deferred.t
  (** [bidirectional_streaming] is the type for an rpc where both the client and server can send multiple messages. *)

There is a route guide implementation using Async that works using Pipe.t it might have some mistakes, I haven't used Pipe.t before.

protoc
-I
.
"--ocaml_out=open=Core;annot=[@@deriving show { with_path = false }, eq, sexp, compare]:."
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Provides an example of deriving sexp and ppx_jane for ocaml-protoc-plugin

@tmcgilchrist
Copy link
Collaborator Author

The failure on debian-12-5.1 should be fixed soon. Core.v0.16.0 is not compatible with OCaml 5.1.

@tmcgilchrist tmcgilchrist merged commit 24a150f into dialohq:main Jul 22, 2023
1 check passed
@tmcgilchrist tmcgilchrist deleted the async_server branch July 22, 2023 06:09
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.

None yet

2 participants