ForgeSdk v1.0.1 ForgeSdk.Queue protocol View Source
Queue protocol.
Link to this section Summary
Functions
Add an item into the queue
Check if queue contains an item
Check if the queue is full
Initialize a queue
Remove an item from the queue, return a tuple including a removed item and a queue
Get the first matched item from the queue and remove it from the queue based on fifo
Return the length of the queue
Link to this section Types
Link to this type
t()
View Source
t()
View Source
t() :: ForgeSdk.Queue.t()
t() :: ForgeSdk.Queue.t()
Link to this section Functions
Link to this function
add(queue, item)
View Source
add(queue, item)
View Source
add(t(), Google.Protobuf.Any.t()) :: t()
add(t(), Google.Protobuf.Any.t()) :: t()
Add an item into the queue.
Link to this function
contains?(queue, item)
View Source
contains?(queue, item)
View Source
contains?(t(), Google.Protobuf.Any.t()) :: boolean()
contains?(t(), Google.Protobuf.Any.t()) :: boolean()
Check if queue contains an item.
Link to this function
full?(queue) View Source
Check if the queue is full.
Link to this function
init(queue, opts \\ []) View Source
Initialize a queue.
Link to this function
pop(queue)
View Source
pop(queue)
View Source
pop(t()) :: {Google.Protobuf.Any.t(), t()}
pop(t()) :: {Google.Protobuf.Any.t(), t()}
Remove an item from the queue, return a tuple including a removed item and a queue.
Link to this function
remove(queue, key, value) View Source
Get the first matched item from the queue and remove it from the queue based on fifo.
Link to this function
size(queue)
View Source
size(queue)
View Source
size(t()) :: non_neg_integer()
size(t()) :: non_neg_integer()
Return the length of the queue.