Liking cljdoc? Tell your friends :D

clj-artnet.impl.shell.buffers

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

borrow!clj

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

buffer-pool?clj

(buffer-pool? x)

Returns true if x is a BufferPool instance.

Returns true if x is a BufferPool instance.
sourceraw docstring

create-poolclj

(create-pool {:keys [count size direct?]
              :or {count 128 size 2048 direct? true}})

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.

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

release!clj

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

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