Pools direct ByteBuffers for zero-allocation UDP I/O.
Provides a thread-safe, hot-path optimized regular buffer pool to minimize garbage collection pressure during high-throughput packet processing.
Pools direct ByteBuffers for zero-allocation UDP I/O. Provides a thread-safe, hot-path optimized regular buffer pool to minimize garbage collection pressure during high-throughput packet processing.
(borrow! pool)Borrows a buffer from the pool (blocking). Resets position/limit before returning. Throws ex-info if the pool is closed.
Borrows a buffer from the pool (blocking). Resets position/limit before returning. Throws ex-info if the pool is closed.
(buffer-pool? x)Returns true if x is a BufferPool instance.
Returns true if x is a BufferPool instance.
(create-pool {:keys [count size direct?]
:or {count 128 size 2048 direct? true}})Creates ByteBuffer pool options.
Options:
Returns a BufferPool which implements java.io.Closeable.
Creates ByteBuffer pool options. Options: - :count -> Number of buffers to preallocate (default 128) - :size -> Buffer capacity in bytes (default 2048) - :direct? -> Use direct buffers (default true) Returns a BufferPool which implements java.io.Closeable.
(release! pool buf)Returns a buffer to the pool. Safe to call multiple times or with nil. Clears buffer before return.
Returns a buffer to the pool. Safe to call multiple times or with nil. Clears buffer before return.
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 |