-
Notifications
You must be signed in to change notification settings - Fork 420
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
Add client support for SwiftGRPCNIO #354
Comments
Agreed; I just haven't gotten around to this. Happy to provide guidance on this, however, once I have capacity in mid-Feb. Some general thoughts:
Not sure yet how we should handle sending request metadata and receiving initial/trailing, metadata, though, especially in the non-error case (when the future is not fulfilled with a Let me know what you think |
Thanks for the insight @MrMage! That makes sense. I like the idea of call options; it keeps the generation and client API fairly straightforward. I was thinking returning some kind of The calls would then be something like: unary(request: Request, options: UnaryCallOptions) -> UnaryCall<Response>
clientStreaming(options: ClientStreamingCallOptions) -> ClientStreamingCall<Response>
serverStreaming(request: Request, options: ServerStreamingCallOptions, handler: (ResponseOrError<Response>) -> Void) -> ServerStreamingCall<Response>
bidirectionalStreaming(options: BiderctionalStreamingCallOptions, handler: (ResponseOrError<Response>) -> Void) -> BiderctionalStreamingCall<Response> It could make for a more consistent API if unary and server streaming requests were also via a unary(options: UnaryCallOptions) -> UnaryCall<Response>
serverStreaming(options: ServerStreamingCallOptions, handler: (ResponseOrError<Response>) -> Void) -> ServerStreamingCall<Response>
client.unary().send(request: request).whenSuccess { ... } That feels a quite Java-esque to me though. I suppose this could be the underlying implementation with an extension provided which allows you to provide the request in the |
Love the idea of having futures for {initial/trailing} metadata and status, I didn't think of those! I understand the idea of consistent API, but for client-unary calls, the client should not be able to send more than one message. I think that's better enforced through just taking the one-and-only request message as a call argument, and makes for much more readable unary calls (which are probably 95%) of the cases. However, not sure how we could attach request metadata to those calls; we could either provide another "Options" argument or have a second method that does return a FYI, make sure to take a look at |
Question Checklist
Question Subject
SwiftGRPCNIO
Question Description
(Not a question as such.) It would be great to have client support for the NIO implementation. I've been playing around this recently and wanted to start a discussion on requirements/ideas for this; particularly around how the API looks.
The text was updated successfully, but these errors were encountered: