Liking cljdoc? Tell your friends :D

clj-grpc.client

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
raw docstring

channelclj

(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 [io.grpc.ClientInterceptor ...] :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     [io.grpc.ClientInterceptor ...]
  :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)
sourceraw docstring

clientclj

(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] ...), ...}.
sourceraw docstring

invokeclj

(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.
sourceraw docstring

shutdownclj

(shutdown ch)
(shutdown ch {:keys [grace-ms]})
source

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close