Documentation ¶
Index ¶
- Variables
- type AbstractCollectionBase
- type ArrayStore
- type BlockingQueue
- func (q *BlockingQueue) Capacity() uint64
- func (q *BlockingQueue) Clear()
- func (q *BlockingQueue) Get() (interface{}, error)
- func (q BlockingQueue) IsEmpty() bool
- func (q *BlockingQueue) Offer(item interface{}) (res bool)
- func (q BlockingQueue) Peek() interface{}
- func (q *BlockingQueue) Pop() (res interface{}, err error)
- func (q *BlockingQueue) Push(item interface{}) (bool, error)
- func (q *BlockingQueue) Put(item interface{}) (bool, error)
- func (q *BlockingQueue) Size() uint64
- type ConcurrentRingBuffer
- type Interface
- type LinkedListStore
- type QueueStore
Constants ¶
This section is empty.
Variables ¶
var ErrorCapacity = errors.New("ERROR_CAPACITY: attempt to Create Queue with invalid Capacity")
var ErrorEmpty = errors.New("ERROR_EMPTY: attempt to Get while Queue is Empty")
var ErrorFull = errors.New("ERROR_FULL: attempt to Put while Queue is Full")
Functions ¶
This section is empty.
Types ¶
type AbstractCollectionBase ¶
type ArrayStore ¶
type ArrayStore struct {
// contains filtered or unexported fields
}
func NewArrayStore ¶
func NewArrayStore(size uint64) *ArrayStore
func (*ArrayStore) Get ¶
func (s *ArrayStore) Get(pos uint64) interface{}
func (*ArrayStore) Remove ¶
func (s *ArrayStore) Remove(pos uint64) interface{}
func (*ArrayStore) Set ¶
func (s *ArrayStore) Set(value interface{}, pos uint64)
func (ArrayStore) Size ¶
func (s ArrayStore) Size() uint64
type BlockingQueue ¶
type BlockingQueue struct {
// contains filtered or unexported fields
}
func NewArrayBlockingQueue ¶
func NewArrayBlockingQueue(capacity uint64) (*BlockingQueue, error)
Creates an BlockingQueue backed by an Array with the given (fixed) capacity returns an error if the capacity is less than 1
func NewLinkedBlockingQueue ¶
func NewLinkedBlockingQueue(capacity uint64) (*BlockingQueue, error)
Creates an BlockingQueue backed by an LinkedList with the given (fixed) capacity returns an error if the capacity is less than 1
func (*BlockingQueue) Capacity ¶
func (q *BlockingQueue) Capacity() uint64
Capacity returns this current elements remaining capacity, is concurrent safe
func (*BlockingQueue) Clear ¶
func (q *BlockingQueue) Clear()
Clears all the queues elements, cleans up, signals waiters for queue is empty
func (*BlockingQueue) Get ¶
func (q *BlockingQueue) Get() (interface{}, error)
Takes an element from the head of the queue. It blocks the current goroutine if the queue is Empty until notified
func (BlockingQueue) IsEmpty ¶
func (q BlockingQueue) IsEmpty() bool
func (*BlockingQueue) Offer ¶
func (q *BlockingQueue) Offer(item interface{}) (res bool)
Inserts the specified element at the tail of this queue if it is possible to do so immediately without exceeding the queue's capacity, returning true upon success and false if this queue is full. Does not block the current goroutine
func (BlockingQueue) Peek ¶
func (q BlockingQueue) Peek() interface{}
Just attempts to return the tail element of the queue
func (*BlockingQueue) Pop ¶
func (q *BlockingQueue) Pop() (res interface{}, err error)
Pops an element from the head of the queue. Does not block the current goroutine
func (*BlockingQueue) Push ¶
func (q *BlockingQueue) Push(item interface{}) (bool, error)
Pushes the specified element at the tail of the queue. Does not block the current goroutine
func (*BlockingQueue) Put ¶
func (q *BlockingQueue) Put(item interface{}) (bool, error)
Puts an element to the tail of the queue. It blocks the current goroutine if the queue is Full until notified
func (*BlockingQueue) Size ¶
func (q *BlockingQueue) Size() uint64
Size returns this current elements size, is concurrent safe
type ConcurrentRingBuffer ¶
type ConcurrentRingBuffer struct {
// contains filtered or unexported fields
}
func NewConcurrentRingBuffer ¶
func NewConcurrentRingBuffer(capacity uint64) *ConcurrentRingBuffer
func (*ConcurrentRingBuffer) Get ¶
func (q *ConcurrentRingBuffer) Get() (interface{}, error)
func (*ConcurrentRingBuffer) Put ¶
func (q *ConcurrentRingBuffer) Put(value interface{}) (bool, error)
type Interface ¶
type Interface interface { AbstractCollectionBase Push(item interface{}) (bool, error) Pop() (interface{}, error) Get() (interface{}, error) Put(item interface{}) (bool, error) Offer(item interface{}) bool Peek() interface{} }
All Queues must implement this interface
type LinkedListStore ¶
type LinkedListStore struct {
// contains filtered or unexported fields
}
func NewLinkedListStore ¶
func NewLinkedListStore(capacity uint64) *LinkedListStore
func (*LinkedListStore) Get ¶
func (s *LinkedListStore) Get(pos uint64) interface{}
func (*LinkedListStore) Remove ¶
func (s *LinkedListStore) Remove(pos uint64) interface{}
func (*LinkedListStore) Set ¶
func (s *LinkedListStore) Set(value interface{}, pos uint64)
func (LinkedListStore) Size ¶
func (s LinkedListStore) Size() uint64