View Source SuperCache.Queue (SuperCache v0.6.0)

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.

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.

Pop value from queue with name is queue_name. If queue_name is not existed or no data, it will return default value.

Functions

add(queue_name, value)

@spec add(any(), any()) :: true

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.

out(queue_name, default \\ nil)

@spec out(any(), any()) :: any()

Pop value from queue with name is queue_name. If queue_name is not existed or no data, it will return default value.