Quasardb API for PHP
Introduction Installation Compilation Configuration API Reference

Classes

  • QdbBatch
  • QdbBatchResult
  • QdbBlob
  • QdbCluster
  • QdbDeque
  • QdbEntry
  • QdbEntryCollection
  • QdbExpirableEntry
  • QdbHashSet
  • QdbInteger
  • QdbTag
  • QdbTagCollection

Exceptions

  • QdbAliasAlreadyExistsException
  • QdbAliasNotFoundException
  • QdbConnectionException
  • QdbContainerEmptyException
  • QdbException
  • QdbIncompatibleTypeException
  • QdbInputException
  • QdbOperationDisabledException
  • QdbOperationException
  • QdbProtocolException
  • QdbSystemException

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.

QdbEntry
Extended by QdbDeque
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

QdbAliasNotFoundException
QdbIncompatibleTypeException
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

QdbAliasNotFoundException
QdbIncompatibleTypeException
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

QdbAliasNotFoundException
QdbIncompatibleTypeException
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

QdbAliasNotFoundException
QdbIncompatibleTypeException
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

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

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

QdbAliasNotFoundException
QdbIncompatibleTypeException

Example

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