Commit bb6bd07
committed
Support for Channel specification on ServiceClient
Adds support to allow consumers to specify a `Channel` when creating `ServiceClient` instances.
This is something already supported by other gRPC language flavors (like [Python](https://github.com/grpc/grpc/blob/7542ba6e0caee740f124dc25706287fd62f546d8/examples/python/multiplex/multiplex_client.py#L110)), and alleviates the need to create a new channel every time a call is made.
Usage:
```swift
let sharedChannel = Channel(address: "https://api.myservice.com", secure: true)
HelloWorldClient(channel: sharedChannel).getHelloWorld(...)
OtherClient(channel: sharedChannel).getOther(...)
```
Resolves #2001 parent 5ebf7a3 commit bb6bd07
File tree
2 files changed
+9
-0
lines changed- Sources/SwiftGRPC
- Core
- Runtime
2 files changed
+9
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| 62 | + | |
61 | 63 | | |
62 | 64 | | |
63 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
58 | 65 | | |
59 | 66 | | |
60 | 67 | | |
| |||
0 commit comments