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
executor]})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 [f-or-ClientInterceptor ...] — fns of the call, (fn [call next] ...), mixed with raw ClientInterceptors; [a b c] runs a outermost. See clj-grpc.interceptor. invoke's opts take the same key per call. :executor Executor for callbacks, or :direct (same sharp edge as the server: never block a direct callback) :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 [f-or-ClientInterceptor ...] — fns of the call,
(fn [call next] ...), mixed with raw ClientInterceptors;
[a b c] runs a outermost. See clj-grpc.interceptor.
invoke's opts take the same key per call.
:executor Executor for callbacks, or :direct (same sharp edge as
the server: never block a direct callback)
: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
{:keys [interceptors headers] :as opts})Call one method. The blocking shapes block; the streaming-in shapes return immediately with the request-side controls.
opts: :deadline-ms, :wait-for-ready, and per call :headers a map of outgoing headers for this call :interceptors [f-or-ClientInterceptor ...] for this call, outermost relative to the channel's; see clj-grpc.interceptor
Call one method. The blocking shapes block; the streaming-in shapes return
immediately with the request-side controls.
opts: :deadline-ms, :wait-for-ready, and per call
:headers a map of outgoing headers for this call
:interceptors [f-or-ClientInterceptor ...] for this call, outermost
relative to the channel's; see clj-grpc.interceptorcljdoc 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 |