open-vault/sdk/queue
Clint e80fa396d2
Add Priority Queue library to sdk (#6664)
* Add priority queue to sdk

* fix issue of storing pointers and now copy

* update to use copy structure

* Remove file, put Item struct def. into other file

* add link

* clean up docs

* refactor internal data structure to hide heap method implementations. Other cleanup after feedback

* rename PushItem and PopItem to just Push/Pop, after encapsulating the heap methods

* updates after feedback

* refactoring/renaming

* guard against pushing a nil item

* minor updates after feedback

* Add read lock to the Len() method and move the interface check into the test file

* fix a deadlock

* make the mutex a RWMutex, and make it private again

* nil check itemRaw before trying to type cast it
2019-05-16 11:15:57 -05:00
..
priority_queue.go Add Priority Queue library to sdk (#6664) 2019-05-16 11:15:57 -05:00
priority_queue_test.go Add Priority Queue library to sdk (#6664) 2019-05-16 11:15:57 -05:00
README.md Add Priority Queue library to sdk (#6664) 2019-05-16 11:15:57 -05:00

Vault SDK - Queue

The queue package provides Vault plugins with a Priority Queue. It can be used as an in-memory list of queue.Item sorted by their priority, and offers methods to find or remove items by their key. Internally it uses container/heap; see Example Priority Queue