Circular Buffer
Installation
Run
$ composer require lctrs/circular-buffer
Usage
Creating an empty circular buffer of size eg. 2:
use Lctrs\CircularBuffer\CircularBuffer;
$buffer = CircularBuffer::ofCapacity(2);
$buffer->write('foo');
$buffer->read(); // foo
You can also create a prefilled buffer:
use Lctrs\CircularBuffer\CircularBuffer;
$buffer = CircularBuffer::prefilled(2, ['foo', 'bar']);
Changelog
Please have a look at CHANGELOG.md
.
Contributing
Please have a look at CONTRIBUTING.md
.
License
This package is licensed using the MIT License.
Please have a look at LICENSE.md
.