+ Example of using a gRPC client: +
+usePlaintext()
- is a JVM binding to Java gRPC runtime. Other bindings are also present.
+ + Artifacts for gRPC integration are published separately + and updated frequently, independent of the main releases. +
+
+
+
+
+
+ gRPC integration is available in an experimental state. + The artifacts are published separately in our Space repository. +
+Below is an example of a project setup.
+settings.gradle.kts
:
+
+ build.gradle.kts
:
+
Here <version>
comes from the badge above.
Kotlin/JVM
projects.
+ + gRPC requires additional code generation from the protoc + compiler. + This can be setup up in the following way: +
+java
- protobuf Java declarationsgrpc
- gRPC Java declarationsgrpckt
- gRPC Kotlin wrappers for Javakotlinx-rpc
- pur wrappers for all of the above
+ You won't need to use the first three directly, only the declarations from the kotlinx-rpc
+ source set are intended to be used.
+
$BUILD_DIR/generated/source/proto/main
directory
+ unless specified otherwise.
+ option("debugOutput=protobuf-plugin.log")
lets you specify the file
+ for the protoc
plugin debug output.
+ option("messageMode=interface")
is intended to be like so. Don't change it.
+ + Example of using a gRPC server: +
+GrpcServer
allows to register multiple services, like regular RpcServer
.
+ However, CoroutineContext
parameter is not needed and should not be used.
+ GrpcServer
does not bind to Java gRPC Server
,
+ but provides some functions to cover for that.
+
+ To define a service, create a new .proto
file in the proto
folder next to your source sets:
+
+ Inside the .proto
file define your service:
+
+ This will generate the necessary code, including the most important interfaces:
+ ImageRecognizer
, Image
, RecogniseResult
:
+
+ You can implement the ImageRecognizer
:
+
+ Here you can also see the usage of the RecogniseResult
interface.
+ To create an instance, use its .invoke()
extension function:
+
Current known limitations:
++ If you encounter other unexpected limitations or bugs, + please report them +
+