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