View Source SuperCache.Queue (SuperCache v0.6.1)
A queue based on cache. Data in queue stored in cache. Can handle multiple queue with different name. A queue is a FIFO data structure. This is global data, any process can access to queue data. Need to start SuperCache.start!/1 before using this module. Ex:
alias SuperCache.Queue
SuperCache.start!()
Queue.add("my_queue", "Hello")
Queue.out("my_queue")
# => "Hello"
Summary
Functions
Add value to queue with name is queue_name. Queue is a FIFO data structure. If queue_name is not existed, it will be created.
Count number of data in queue with name is queue_name. If queue_name is not existed, it will return 0.
Get all items in queue. If queue_name is not existed, it will return []. If queue is empty, it will return [].
Pop value from queue with name is queue_name. If queue_name is not existed or no data, it will return default value.
Peak value from queue with name is queue_name. Data still in queue after peak. If queue_name is not existed or no data, it will return default value.
Functions
Add value to queue with name is queue_name. Queue is a FIFO data structure. If queue_name is not existed, it will be created.
Count number of data in queue with name is queue_name. If queue_name is not existed, it will return 0.
Get all items in queue. If queue_name is not existed, it will return []. If queue is empty, it will return [].
Pop value from queue with name is queue_name. If queue_name is not existed or no data, it will return default value.
Peak value from queue with name is queue_name. Data still in queue after peak. If queue_name is not existed or no data, it will return default value.