Experimental signal backends for beckon
built entirely on the Java Foreign Function & Memory API (JDK 22+), as an
alternative to beckon's default sun.misc.Signal backend:
signalfd(2)kqueue(2) with EVFILT_SIGNALIt exists because sun.misc.Signal is an internal JDK API that may eventually be
removed; this proves out the supported modern replacement. It is experimental
and shipped separately precisely because it needs JDK 22+, while beckon's core
jar targets JDK 8.
Add both beckon and beckon-ffm, then opt in with a system property.
[net.clojars.savya/beckon "0.4.0"]
[net.clojars.savya/beckon-ffm "0.1.0"]
Run the JVM with:
-Dbeckon.signal.backend=ffm --enable-native-access=ALL-UNNAMED
The right native mechanism is selected automatically for the platform. The beckon API is unchanged - see the beckon README.
The two implementations differ, which is instructive:
signalfd) reliably handles beckon's own raise!, but not signals
from outside the process (e.g. kill -HUP): a JVM starts threads before
beckon loads, and signalfd only captures a signal blocked in every thread,
which cannot be arranged retroactively.kqueue) sets each managed signal to SIG_IGN - a process-wide
disposition - so it also observes external signals.Because of the Linux limitation and JEP 472 native-access restrictions
(--enable-native-access, denied by default from JDK 26), this is not a drop-in
replacement; sun.misc.Signal remains beckon's default.
Requires JDK 22 or later (Foreign Function & Memory API, JEP 454). Linux and macOS/BSD only. Continuously tested on JDK 25 across Ubuntu and macOS.
Copyright © 2026 Savyasachi.
A companion to beckon (originally by Jean Niklas L'orange). Distributed under the Eclipse Public License, the same as Clojure.
Can you improve this documentation?Edit on GitHub
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 |