Quasardb API for PHP
Introduction Installation Compilation Configuration API Reference

Namespaces

  • qdb

Classes

  • QdbAliasAlreadyExistsException
  • QdbAliasNotFoundException
  • QdbBatch
  • QdbBatchResult
  • QdbBlob
  • QdbCluster
  • QdbConnectionException
  • QdbContainerEmptyException
  • QdbDeque
  • QdbEntry
  • QdbEntryCollection
  • QdbException
  • QdbExpirableEntry
  • QdbIncompatibleTypeException
  • QdbInputException
  • QdbInteger
  • QdbOperationDisabledException
  • QdbOperationException
  • QdbProtocolException
  • QdbSystemException
  • QdbTag
  • QdbTagCollection

Class QdbDeque

A queue of blob in the database.

It's a double-ended queue, you can both enqueue and dequeue from the front and the back.

qdb\QdbEntry
Extended by qdb\QdbDeque
Namespace: qdb
Example:

You get a QdbDeque instance by calling \QdbCluster::deque(). Then you can perform atomic operations on the queue:

$queue = $cluster->deque('my queue');
$queue->pushBack('value 0');
$queue->pushBack('value 1');

Methods summary
public string
# back( )

Gets the element at the end of the queue.

Gets the element at the end of the queue.

Returns

string
The last element of the queue.

Throws

qdb\QdbAliasNotFoundException
qdb\QdbIncompatibleTypeException
qdb\QdbContainerEmptyException

Example

$last = $cluster->deque('alias')->back();
public string
# front( )

Gets the element at the beginning of the queue.

Gets the element at the beginning of the queue.

Returns

string
The first element of the queue.

Throws

qdb\QdbAliasNotFoundException
qdb\QdbIncompatibleTypeException
qdb\QdbContainerEmptyException

Example

$first = $cluster->deque('alias')->front();
public string
# popBack( )

Dequeues from the end of the queue and returns the value.

Dequeues from the end of the queue and returns the value.

Returns

string
The last element of the queue.

Throws

qdb\QdbAliasNotFoundException
qdb\QdbIncompatibleTypeException
qdb\QdbContainerEmptyException

Example

$last = $cluster->deque('alias')->popBack();
public string
# popFront( )

Dequeues from the beginning of the queue and returns the value.

Dequeues from the beginning of the queue and returns the value.

Returns

string
The first element of the queue.

Throws

qdb\QdbAliasNotFoundException
qdb\QdbIncompatibleTypeException
qdb\QdbContainerEmptyException

Example

$first = $cluster->deque('alias')->popFront();
public
# pushBack( string $content )

Enqueues the specified value at the end of the queue. Creates the queue if needed.

Enqueues the specified value at the end of the queue. Creates the queue if needed.

Parameters

$content
The value to enqueue.

Throws

qdb\QdbIncompatibleTypeException

Example

$cluster->deque('alias')->pushBack('content');
public
# pushFront( string $content )

Enqueues the specified value at the beginning of the queue. Creates the queue if needed.

Enqueues the specified value at the beginning of the queue. Creates the queue if needed.

Parameters

$content
The value to enqueue.

Throws

qdb\QdbIncompatibleTypeException

Example

$cluster->deque('alias')->pushFront('content');
public integer
# size( )

Gets the length of the queue.

Gets the length of the queue.

Returns

integer
The number of elements in the queue.

Throws

qdb\QdbAliasNotFoundException
qdb\QdbIncompatibleTypeException

Example

$elementCount = $cluster->deque('alias')->size();
Methods inherited from qdb\QdbEntry
alias(), attachTag(), attachTags(), detachTag(), getTags(), hasTag(), remove()
Copyright 2009-2018 quasardb SAS Documentation generated by ApiGen