crawlie v0.5.1 Crawlie.PqueueWrapper

Wraps the Erlang pqueue :pqueue, :pqueue2, :pqueue3 and :pqueue4 modules functionality for easier use in Elixir and easier swapping of the implementations

Summary

Functions

Adds a Crawlie.Page to this priority queue, treating its depth as priority - the bigger the depth, the bigger the priority

Checks if this priority queue is empty

based on the page depht gets a priority to use with the queue, to utilize the particular pqueue’s tusage best

Returns the size of the underlying queue

Constructs a new Crawlie.PqueueWrapper priority queue with module as the underlying impelementation

Takes an element with the highes priority from the priority queue and returns the priority queue without the element and the element itself

Types

t()
t() :: %Crawlie.PqueueWrapper{data: term, module: atom}

Functions

Adds a Crawlie.Page to this priority queue, treating its depth as priority - the bigger the depth, the bigger the priority.

all(this)
all(Crawlie.PqueueWrapper.t) :: [term]
empty?(pqueue_wrapper)
empty?(Crawlie.PqueueWrapper.t) :: boolean

Checks if this priority queue is empty.

get_priority(pqueue_wrapper, depth)

based on the page depht gets a priority to use with the queue, to utilize the particular pqueue’s tusage best

len(pqueue_wrapper)
len(Crawlie.PqueueWrapper.t) :: integer

Returns the size of the underlying queue.

new(module)

Constructs a new Crawlie.PqueueWrapper priority queue with module as the underlying impelementation.

Takes an element with the highes priority from the priority queue and returns the priority queue without the element and the element itself.