Skip to content

Commit bd65a33

Browse files
authored
Improve codegen documentation (#108)
- It's required to load gRPCClient before calling protojl: make it clear in the docs
1 parent 2e39c9c commit bd65a33

2 files changed

Lines changed: 17 additions & 15 deletions

File tree

docs/src/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ gRPCClient.jl integrates with ProtoBuf.jl to automatically generate Julia client
3737

3838
```julia
3939
using ProtoBuf
40+
41+
# Loading gRPCClient before calling protojl is required — it registers the service stub generator that adds client constructors to the output.
4042
using gRPCClient
4143

4244
# Creates Julia bindings for the messages and RPC defined in test.proto

docs/src/llms.txt

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ gRPCClient.jl integrates with ProtoBuf.jl to automatically generate Julia client
3737

3838
```julia
3939
using ProtoBuf
40+
41+
# Loading gRPCClient before calling protojl is required — it registers the service stub generator that adds client constructors to the output.
4042
using gRPCClient
4143

4244
# Creates Julia bindings for the messages and RPC defined in test.proto
@@ -77,7 +79,7 @@ client = TestService_TestRPC_Client("172.238.177.88", 8001; grpc=grpc_myapp)
7779
grpc_shutdown(grpc_myapp)
7880
```
7981

80-
[source](https://github.com/JuliaIO/gRPCClient.jl/blob/74046e6e0b01dd787e9c901f5fde79ff3674f0e5/src/gRPC.jl#L10-L28)
82+
[source](https://github.com/JuliaIO/gRPCClient.jl/blob/2e39c9c699b979f81dd966129119e56afba0c3aa/src/gRPC.jl#L10-L28)
8183

8284
```
8385
gRPCClient.grpc_shutdown — Method.
@@ -91,7 +93,7 @@ Shuts down the `gRPCCURL`. This neatly cleans up all active connections and requ
9193
development with Revise. Unless specifying the `gRPCCURL`, the global one provided by `grpc_global_handle()` is
9294
shutdown.
9395

94-
[source](https://github.com/JuliaIO/gRPCClient.jl/blob/74046e6e0b01dd787e9c901f5fde79ff3674f0e5/src/gRPC.jl#L32-L36)
96+
[source](https://github.com/JuliaIO/gRPCClient.jl/blob/2e39c9c699b979f81dd966129119e56afba0c3aa/src/gRPC.jl#L32-L36)
9597

9698
```
9799
gRPCClient.grpc_global_handle — Method.
@@ -104,7 +106,7 @@ grpc_global_handle()
104106
Returns the global `gRPCCURL` state which contains a libCURL multi handle. By default all gRPC clients use this multi in
105107
order to ensure that HTTP/2 multiplexing happens where possible.
106108

107-
[source](https://github.com/JuliaIO/gRPCClient.jl/blob/74046e6e0b01dd787e9c901f5fde79ff3674f0e5/src/gRPC.jl#L3-L7)
109+
[source](https://github.com/JuliaIO/gRPCClient.jl/blob/2e39c9c699b979f81dd966129119e56afba0c3aa/src/gRPC.jl#L3-L7)
108110

109111
### Generated ServiceClient Constructors
110112

@@ -197,7 +199,7 @@ for request in requests
197199
end
198200
```
199201

200-
[source](https://github.com/JuliaIO/gRPCClient.jl/blob/74046e6e0b01dd787e9c901f5fde79ff3674f0e5/src/Unary.jl#L3-L31)
202+
[source](https://github.com/JuliaIO/gRPCClient.jl/blob/2e39c9c699b979f81dd966129119e56afba0c3aa/src/Unary.jl#L3-L31)
201203

202204
```
203205
gRPCClient.grpc_async_request — Method.
@@ -237,7 +239,7 @@ for i in 1:N
237239
end
238240
```
239241

240-
[source](https://github.com/JuliaIO/gRPCClient.jl/blob/74046e6e0b01dd787e9c901f5fde79ff3674f0e5/src/Unary.jl#L70-L101)
242+
[source](https://github.com/JuliaIO/gRPCClient.jl/blob/2e39c9c699b979f81dd966129119e56afba0c3aa/src/Unary.jl#L70-L101)
241243

242244
```
243245
gRPCClient.grpc_async_await — Method.
@@ -250,7 +252,7 @@ grpc_async_await(client::gRPCServiceClient{TRequest,false,TResponse,false}, requ
250252
Wait for the request to complete and return the response when it is ready. Throws any exceptions that were encountered
251253
during handling of the request.
252254

253-
[source](https://github.com/JuliaIO/gRPCClient.jl/blob/74046e6e0b01dd787e9c901f5fde79ff3674f0e5/src/Unary.jl#L145-L149)
255+
[source](https://github.com/JuliaIO/gRPCClient.jl/blob/2e39c9c699b979f81dd966129119e56afba0c3aa/src/Unary.jl#L145-L149)
254256

255257
```
256258
gRPCClient.grpc_sync_request — Method.
@@ -278,7 +280,7 @@ response = grpc_sync_request(client, TestRequest(1, zeros(UInt64, 1)))
278280
@info response
279281
```
280282

281-
[source](https://github.com/JuliaIO/gRPCClient.jl/blob/74046e6e0b01dd787e9c901f5fde79ff3674f0e5/src/Unary.jl#L156-L176)
283+
[source](https://github.com/JuliaIO/gRPCClient.jl/blob/2e39c9c699b979f81dd966129119e56afba0c3aa/src/Unary.jl#L156-L176)
282284

283285
#### Streaming
284286

@@ -316,7 +318,7 @@ close(request_c)
316318
test_response = grpc_async_await(client, req)
317319
```
318320

319-
[source](https://github.com/JuliaIO/gRPCClient.jl/blob/74046e6e0b01dd787e9c901f5fde79ff3674f0e5/src/Streaming.jl#L110-L138)
321+
[source](https://github.com/JuliaIO/gRPCClient.jl/blob/2e39c9c699b979f81dd966129119e56afba0c3aa/src/Streaming.jl#L110-L138)
320322

321323
```
322324
gRPCClient.grpc_async_request — Method.
@@ -352,7 +354,7 @@ end
352354
grpc_async_await(req)
353355
```
354356

355-
[source](https://github.com/JuliaIO/gRPCClient.jl/blob/74046e6e0b01dd787e9c901f5fde79ff3674f0e5/src/Streaming.jl#L167-L195)
357+
[source](https://github.com/JuliaIO/gRPCClient.jl/blob/2e39c9c699b979f81dd966129119e56afba0c3aa/src/Streaming.jl#L167-L195)
356358

357359
```
358360
gRPCClient.grpc_async_request — Method.
@@ -394,7 +396,7 @@ close(request_c)
394396
grpc_async_await(req)
395397
```
396398

397-
[source](https://github.com/JuliaIO/gRPCClient.jl/blob/74046e6e0b01dd787e9c901f5fde79ff3674f0e5/src/Streaming.jl#L231-L265)
399+
[source](https://github.com/JuliaIO/gRPCClient.jl/blob/2e39c9c699b979f81dd966129119e56afba0c3aa/src/Streaming.jl#L231-L265)
398400

399401
```
400402
gRPCClient.grpc_async_await — Method.
@@ -406,7 +408,7 @@ grpc_async_await(client::gRPCServiceClient{TRequest,true,TResponse,false},reques
406408

407409
Raise any exceptions encountered during the streaming request.
408410

409-
[source](https://github.com/JuliaIO/gRPCClient.jl/blob/74046e6e0b01dd787e9c901f5fde79ff3674f0e5/src/Streaming.jl#L299-L303)
411+
[source](https://github.com/JuliaIO/gRPCClient.jl/blob/2e39c9c699b979f81dd966129119e56afba0c3aa/src/Streaming.jl#L299-L303)
410412

411413
### Exceptions
412414

@@ -422,7 +424,7 @@ This exception type has two fields:
422424
1. `grpc_status::Int` - See [here](https://grpc.io/docs/guides/status-codes/) for an indepth explanation of each status.
423425
2. `message::String`
424426

425-
[source](https://github.com/JuliaIO/gRPCClient.jl/blob/74046e6e0b01dd787e9c901f5fde79ff3674f0e5/src/gRPCClient.jl#L21-L29)
427+
[source](https://github.com/JuliaIO/gRPCClient.jl/blob/2e39c9c699b979f81dd966129119e56afba0c3aa/src/gRPCClient.jl#L21-L29)
426428

427429
## gRPCClientUtils.jl
428430

@@ -470,6 +472,4 @@ In addition to benchmarks, a number of workloads based on these are available:
470472
- `stress_workload_streaming_response()`
471473
- `stress_workload_streaming_bidirectional()`
472474

473-
These run forever, and are useful to help identify any stability issues or resource leaks.
474-
475-
475+
These run forever, and are useful to help identify any stability issues or resource leaks.

0 commit comments

Comments
 (0)