Channels and calls, from the same methods map the server consumes.
(def ch (channel "localhost:8080" {:plaintext true}))
(invoke ch (:say-hello greeter/greeter-methods) request)
Call shapes, by method type: :unary request -> response (blocking) :server-streaming request -> lazy seq of responses (blocking iterator) :client-streaming -> {:send! (fn [msg]) :close! (fn []) :response promise} :bidi observer-map -> {:send! ... :close! ...}; responses arrive through the caller's {:on-next ...} map
Channels and calls, from the same methods map the server consumes.
(def ch (channel "localhost:8080" {:plaintext true}))
(invoke ch (:say-hello greeter/greeter-methods) request)
Call shapes, by method type:
:unary request -> response (blocking)
:server-streaming request -> lazy seq of responses (blocking iterator)
:client-streaming -> {:send! (fn [msg]) :close! (fn []) :response promise}
:bidi observer-map -> {:send! ... :close! ...}; responses
arrive through the caller's {:on-next ...} map(channel target
{:keys [plaintext transport keepalive idle-timeout-ms
max-inbound-message-size interceptors default-service-config]})target: "host:port" | "dns:///..." | "unix:///path" | {:unix path} opts: :plaintext true for h2c — what a Knative service speaks; default true for unix targets, false otherwise :transport :auto (default) | :epoll | :nio; UDS requires epoll :keepalive {:time-ms n :timeout-ms n :without-calls bool} — keep the connection warm through idle proxies (Knative activator) :idle-timeout-ms channel idle timeout :max-inbound-message-size bytes :interceptors [io.grpc.ClientInterceptor ...] :default-service-config map, e.g. retry policy (enables retries when set)
target: "host:port" | "dns:///..." | "unix:///path" | {:unix path}
opts:
:plaintext true for h2c — what a Knative service speaks; default
true for unix targets, false otherwise
:transport :auto (default) | :epoll | :nio; UDS requires epoll
:keepalive {:time-ms n :timeout-ms n :without-calls bool} — keep the
connection warm through idle proxies (Knative activator)
:idle-timeout-ms channel idle timeout
:max-inbound-message-size bytes
:interceptors [io.grpc.ClientInterceptor ...]
:default-service-config map, e.g. retry policy (enables retries when set)(client ch methods)(client ch methods default-opts)The whole service as a map of fns: {:say-hello (fn [request] ...), ...}.
The whole service as a map of fns: {:say-hello (fn [request] ...), ...}.
(invoke ch method request)(invoke ch {:keys [type method-descriptor]} request opts)Call one method. The blocking shapes block; the streaming-in shapes return immediately with the request-side controls.
Call one method. The blocking shapes block; the streaming-in shapes return immediately with the request-side controls.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |