NotifyingByteQueue

Request Queue implementation and logic.

A concrete client will probably prefer to use the templated version

Constructors

this
this(size_t max_bytes)

Constructor

this
this(IByteQueue queue)

Constructor

Members

Aliases

NotificationDg
alias NotificationDg = void delegate()

Type of the delegate used for notifications

Functions

free_space
ulong free_space()
isRegistered
bool isRegistered(NotificationDg notifier)

Check whether the provided notifier is already registered. This allows the code to avoid calling ready() with the same notifier, which may throw or add duplicate notifiers.

is_empty
bool is_empty()

Tells whether the queue is empty.

length
size_t length()
pop
void[] pop()

pops an element if the queue is enabled

push
bool push(void[] data)

Push an item into the queue and notify the next waiting notification delegate about it.

push
bool push(size_t size, void delegate(void[]) filler)

Push an item into the queue and notify the next waiting handler about it.

ready
bool ready(NotificationDg notifier)

register an handler as available

resume
void resume()

resume consuming of the queue

suspend
void suspend()

suspend consuming of the queue

suspended
bool suspended()

Returns true if the queue is suspended, else false

total_space
ulong total_space()
used_space
ulong used_space()
waiting
size_t waiting()
willFit
bool willFit(size_t bytes)

Finds out whether the provided number of bytes will fit in the queue. Also considers the need of wrapping.

Inherited Members

From ISuspendable

suspend
void suspend()

Requests that further processing be temporarily suspended, until resume() is called.

resume
void resume()

Requests that processing be resumed.

suspended
bool suspended()

From IQueueInfo

length
size_t length()
used_space
ulong used_space()
free_space
ulong free_space()
total_space
ulong total_space()
is_empty
bool is_empty()

Tells whether the queue is empty.

willFit
bool willFit(size_t bytes)

Finds out whether the provided number of bytes will fit in the queue.

Meta