Represents a subchannel for grouping input and output events related to an I/O resource such as an opened file or a network connection.
Defines the contract between a component using non blocking I/O and the
A component that reads from or writes to a file.
A component that watches for new input on an
A simple implementation of
A helper component that provides the central hub for non blocking I/O components.
I/O related components built on top of the core package.
JGrapes manages buffers in pools. The framework therefore
that wraps a NIO buffer, adding the information required for
managing the buffer.
Pooling is not done to avoid garbage collection, but for shaping streams of data. Imagine a pipeline where stage A produces data much faster than stage B can handle it. If we allowed arbitrary buffer allocation, it might happen that a lot of memory is used for buffers created by stage A and not yet consumed by stage B.
Using a buffer pool limits the the production rate of stage A without reducing the overall performance. When all buffers are in use, stage A has to wait until some data is consumed by stage B and a buffer is freed. But as soon as this is the case, stage A can continue to produce data in parallel (unless you set the pool size to 1, of course).