Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lurado/ldocappedqueue

A queue that doesn't grow indefinitely.
https://github.com/lurado/ldocappedqueue

data-structures ios macos objective-c

Last synced: 4 days ago
JSON representation

A queue that doesn't grow indefinitely.

Awesome Lists containing this project

README

        

# LDOCappedQueue

A queue that only holds a maximum number of items and discards the least recently added ones, if new ones are added and the capacity is reached.

It's a relatively thin wrapper around `NSMutableArray`, which is implemented as a circular buffer [according to this blog post by Bartosz Ciechanowski](http://ciechanowski.me/blog/2014/03/05/exposing-nsmutablearray/)). Therefore enqueueing and dequeueing are O(1) operations.

The implementation is not thread safe.

## Installation

LDOCappedQueue is available through [CocoaPods](https://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod "LDOCappedQueue"
```

## Author

Julian Raschke und Sebastian Ludwig GbR, https://www.lurado.com

## License

LDOCappedQueue is available under the MIT license. See the LICENSE file for more info.