Interface IReleasable
- All Known Implementing Classes:
BufferReadStream, MonitoredReadStream, VertxStream.ReadStreamStream
public interface IReleasable
Opt-in trait for a
ReadStream<Buffer> that owns an external resource
(e.g. an mmap-pool chunk) and needs an explicit signal to free it once a
downstream consumer is done with the bytes.
The contract is that release() may only be called once the consumer
has guaranteed all emitted buffers are no longer needed. Implementations
must be idempotent: redundant calls are silently ignored.
For HTTP responses this signal is taken at
Pipe completion — see
RestHttpProxyHandler: at that point every netty
ChannelPromise for the preceding writes has already fired, so the
bytes are at least in the kernel send buffer and the underlying memory can
be safely released.
-
Method Summary
-
Method Details
-
release
void release()Releases the underlying resource. Idempotent — subsequent calls are no-ops.
-