-
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
Develop code generation for gRPC Services. #2
Comments
As a separate plugin, per Thomas' reasoning in apple/swift-protobuf#118 :) |
From the look of objective-c generator / it's intermingled into visual studio at some point. objective-c generator Part 1) Part 2) |
I've been looking into different widgets to get job done - so - if we throw this at antlr-swift I think biting the bullet and going Swift is nice scenic route. c++ while it will work - will be hard(er) for future offshoot libraries to hot wire. (like Alamofire swapping in their libraries) We can then plug into antlr swift runtime DRAFTED |
Oh, but So the plugin can be written in Swift alright, and just needs to conform to that protocol to get the parsing for free. |
then cherry picking Apple's work is best option. Then we just need the canonical example. service MasterService {
// Creates a session.
rpc CreateSession(CreateSessionRequest) returns (CreateSessionResponse);
// Extends a session.
rpc ExtendSession(ExtendSessionRequest) returns (ExtendSessionResponse);
// Prepares future partial run calls.
rpc PartialRunSetup(PartialRunSetupRequest) returns (PartialRunSetupResponse);
// Drives the graph computation.
rpc RunStep(RunStepRequest) returns (RunStepResponse);
// Closes a session.
rpc CloseSession(CloseSessionRequest) returns (CloseSessionResponse);
// List the devices usable by the master.
rpc ListDevices(ListDevicesRequest) returns (ListDevicesResponse);
// Close all existing sessions.
rpc Reset(ResetRequest) returns (ResetResponse);
} then .... fill in the gaps .... |
This Edge framework for server side swift seems like nice path forward (albeit not suitable for ios) |
So - need to commit to specific interoperable network library. I found this - a swifty version of libcurl wrapped around IBMs' swift libcurl. @jcanizales - did you envisage the RxLibrary having a life beyond objective-c? I read in comments - you said it should eventually be separated from grpc library. |
RxLibrary, like many others, is nicer to use from Swift than ObjC. And it can be used standalone by just depending on the I've had in my mind, for a while, to create a doc comparing proposed surfaces for Swift gRPC: one using RxSwift, the other ReactiveSwift, and what we have today from importing the ObjC library. Between RxSwift and ReactiveSwift, I personally think having different types for "hot" and "cold" streams is a better idea. But from the POV of the user, it's best if it matches whatever rx library you're already using in your app. That means that either:
|
fyi Kitura/CCurl#10 |
With this commit, there's a code generating plugin in the Plugins directory that generates client and server stubs for all four API types (Unary, Server Streaming, Client Streaming, Bidi Streaming). The plugin uses templates in the Plugins/templates directory and currently these must be in the same directory where the plugin is run. Templates use Kyle Fuller's Stencil package and will hopefully be easy to modify with improvements or for other calling styles. The current generated code surface closely follows the Go grpc generator. |
@timburks - thanks for your efforts here - pleased to say I got the service classes spat out (untested) for tensorflow. https://github.com/nubbel/swift-tensorflow/ |
Contains the following commits: - Refactor gRPC decoding into dedicated codec classes. - Start work on GRPCServerHandler. - Add a "unary call handler" and use that for the tests. - Refactoring starting a GRPC server into a dedicated class. - Fix sending unary responses. - Add a handler for client-streaming calls. - Also implement bidirectional-streaming calls. - Make sure to flush in server-streaming calls after each sent message. - Add the missing test cases to `allTests`. - Refactor `StatusSendingHandler` into its own class. - Rename `GRPCServerHandler` to `GRPCChannelHandler`. - Remove a FIXME. - Add a few more comments. - Attach the actual call handlers as channel handlers instead of manually forwarding messages to them. # This is the commit message grpc#2: Remove SwiftGRPCNIO's dependency on SwiftGRPC and move the responsibility for encoding GRPC statuses to HTTP1ToRawGRPCServerCoded. # This is the commit message grpc#3: Temporarily disable two test cases that are failing at the moment. # This is the commit message grpc#4: Add SwiftGRPCNIO as an exposed library. # This is the commit message grpc#5: Another try at getting CI to work with SwiftGRPCNIO. # This is the commit message grpc#6: More dependency fixes. # This is the commit message grpc#7: Add `SwiftGRPCNIO.EchoServerTests` to LinuxMain.swift. # This is the commit message grpc#8: Fix a string comparison in `.travis-install.sh`. # This is the commit message grpc#9: Add nghttp2 to the list of CI dependencies. # This is the commit message grpc#10: Another try with installing nghttp2 via brew. # This is the commit message grpc#11: Another try at using libnghttp2-dev under Ubuntu 14.04. # This is the commit message grpc#12: More Travis fixes. # This is the commit message grpc#13: One last try. # This is the commit message grpc#2: Disable two more tests for now, as they sometimes fail on CI. # This is the commit message grpc#3: Make Carthage debug builds verbose. # This is the commit message grpc#4: Only use SwiftGRPC-Carthage.xcodeproj for Carthage builds.
* Proposal to fix #362. Allows user to setup a channel with a client certificate and key but still use default root certificates. * fix #362. Respect PR critique. make roots_pem() public. Update Channel init. * fix #362: make roots_pem() return force-unwrapped String. Change Channel API accordingly. * Remove an obsolete comment. * Minor whitespace tweak #1 * Minor whitespace tweak #2
Currently there is no code generation for gRPC services. This needs to be added either to the swift-proto plugin or to a separate plugin.
The text was updated successfully, but these errors were encountered: