Liking cljdoc? Tell your friends :D

clj-grpc.impl.netty

Every Netty and grpc-netty construction in the library, quarantined.

This namespace exists for GraalVM native-image. Clojure initializes the classes a compiled namespace references when the namespace loads, and under --initialize-at-build-time namespace loading happens during image build — where Netty's own native-image metadata forbids initializing its native-library and Unsafe-touching classes, correctly. The API namespaces (transport, server, client) therefore reference this one only through requiring-resolve at first construction, never :require, and the library's META-INF/native-image config marks the clj_grpc.impl package initialize-at-run-time and registers this namespace's init class for the runtime require. Net effect: Netty initializes at first server/channel construction — run time in both worlds — and requiring the API namespaces stays Netty-free. lazy_netty_test pins both halves of that contract.

Class names are written fully qualified rather than :import'ed on purpose: imports are interned by the namespace loader through Class.forName, and at run time in a native image every such name would need a reflection entry. Fully-qualified interop compiles to direct method references; only classes used as values (the channel classes below) go through Class.forName, and exactly those are registered in reflect-config.json.

Every Netty and grpc-netty construction in the library, quarantined.

This namespace exists for GraalVM native-image. Clojure initializes the
classes a compiled namespace references when the namespace loads, and under
--initialize-at-build-time namespace loading happens during image build —
where Netty's own native-image metadata forbids initializing its
native-library and Unsafe-touching classes, correctly. The API namespaces
(transport, server, client) therefore reference this one only through
requiring-resolve at first construction, never :require, and the library's
META-INF/native-image config marks the clj_grpc.impl package
initialize-at-run-time and registers this namespace's init class for the
runtime require. Net effect: Netty initializes at first server/channel
construction — run time in both worlds — and requiring the API namespaces
stays Netty-free. lazy_netty_test pins both halves of that contract.

Class names are written fully qualified rather than :import'ed on purpose:
imports are interned by the namespace loader through Class.forName, and at
run time in a native image every such name would need a reflection entry.
Fully-qualified interop compiles to direct method references; only classes
used as *values* (the channel classes below) go through Class.forName, and
exactly those are registered in reflect-config.json.
raw docstring

channel-builderclj

(channel-builder target {:keys [transport unix?]})

A NettyChannelBuilder for the target with transport wired, returned as the generic ManagedChannelBuilder; clj-grpc.client does the rest generically.

A NettyChannelBuilder for the target with transport wired, returned as the
generic ManagedChannelBuilder; clj-grpc.client does the rest generically.
sourceraw docstring

client-channel-classclj

(client-channel-class transport unix?)
source

epoll-available?clj

(epoll-available?)
source

epoll-unavailability-causeclj

(epoll-unavailability-cause)
source

event-loop-groupclj

(event-loop-group transport threads)

Daemon threads, deliberately — grpc's own default groups are daemon too. A non-daemon event loop pins the JVM after main returns, which surfaces as 'tests pass, process never exits' the first time anything runs outside a harness that calls System/exit.

Daemon threads, deliberately — grpc's own default groups are daemon too. A
non-daemon event loop pins the JVM after main returns, which surfaces as
'tests pass, process never exits' the first time anything runs outside a
harness that calls System/exit.
sourceraw docstring

server-builderclj

(server-builder addr {:keys [transport unix? permit-keepalive]})

A NettyServerBuilder with everything transport-specific applied, returned as the generic ServerBuilder; clj-grpc.server layers the transport-agnostic configuration on top without touching a Netty type.

A NettyServerBuilder with everything transport-specific applied, returned
as the generic ServerBuilder; clj-grpc.server layers the transport-agnostic
configuration on top without touching a Netty type.
sourceraw docstring

server-channel-classclj

(server-channel-class transport unix?)
source

unix-address?clj

(unix-address? addr)
source

unix-socket-addressclj

(unix-socket-address path)
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