Repository navigation
gRPCClient v1.2.0
gRPCClient.jl 1.2.0 introduces a new and improved API. Each service is now generated as a module of RPC functions called on a reusable gRPCChannel, which gives typed signatures, per-RPC docstrings, and better IDE support. It is the recommended interface for new code. The legacy API is still supported and has not changed.
The new interface was designed and implemented by @johroj (#128, #139, #134), following the discussion in #122. Thank you!
New features
- Module-per-service API. Code generation now emits a module for each
service, with one function per RPC called on a reusablegRPCChannel(now exported). All RPC kinds are supported: synchronous and asynchronous unary, client streaming, server streaming and bidirectional streaming. Asynchronous and streaming calls return handles that supportput!,take!,fetch,isready,wait,closeanddetach, plusiteratefor consuming a response stream of unknown length. RawVector{UInt8}requests and responses work with the new interface just as they do with the legacy one. (#128, #139, @johroj) - Codegen controls.
grpc_register_service_codegen(; legacy = true, servicemodule = true)selects which APIs are generated. Both are on by default. For new applicationslegacy = falseis recommended: it generates less code and gives better IDE suggestions. When both are on, the generated file contains a version guard so it still loads, using the legacy API, on older versions of gRPCClient.jl. (#128, @johroj) - Generated RPCs get docstrings and type-annotated signatures. (#128, @johroj)
Bug fixes
- A request submitted to a handle that is shut down or not initialized, or a request queued for a
max_streamsslot when the handle shuts down, now raisesUNAVAILABLEinstead ofFAILED_PRECONDITION. A shut-down handle is usually being reset, so the call is retryable, andUNAVAILABLEis the code grpc-java uses for calls on a shut-down channel. (#147)
This is the first of what may be several corrections to make the status codes gRPCClient.jl assigns consistent with other gRPC clients. Further corrections may ship in future minor releases but will not change within patch releases. Do not depend on specific status codes beyond whether a call succeeded (OK) or failed. See the warning on the Error Handling page of the docs. (#149)
Notes
- The documentation has been rewritten for the new API and reorganized into a multi-page site with a landing page. (#134 by @johroj, #150)
Merged pull requests:
- Simplified API (#128) (@johroj)
- Updates to simplified API (#139) (@johroj)
- Documentation for updated API (#134) (@johroj)
- Shut-down handles report UNAVAILABLE (#147) (@csvance)
- Note that non-OK status codes are not yet stable (#149) (@csvance)
- Tag 1.2.0 + DocumenterLandingPage+CodeBlocks (#150) (@csvance)
- CI improvements (#137) (@csvance)
- Add Julia nightly badge to README (#138) (@csvance)
- Add Dependabot configuration (#141) (@csvance)
- Read Go version for CI from test/go/go.mod (#146) (@csvance)