TransactionalQueue

class TransactionalQueue(name, transaction, context)

Bases: hazelcast.proxy.base.TransactionalProxy

Transactional implementation of Queue.

offer(item, timeout=0)

Transactional implementation of Queue.offer(item, timeout)

Parameters
  • item – The item to be added.

  • timeout (int) – Maximum time in seconds to wait for addition.

Returns

True if the element was added to this queue, False otherwise.

Return type

hazelcast.future.Future[bool]

take()

Transactional implementation of Queue.take()

Returns

The head of this queue.

Return type

hazelcast.future.Future[any]

poll(timeout=0)

Transactional implementation of Queue.poll(timeout)

Parameters

timeout (int) – Maximum time in seconds to wait for addition.

Returns

The head of this queue, or None if this queue is empty

or specified timeout elapses before an item is added to the queue.

Return type

hazelcast.future.Future[any]

peek(timeout=0)

Transactional implementation of Queue.peek(timeout)

Parameters

timeout (int) – Maximum time in seconds to wait for addition.

Returns

The head of this queue, or None if this queue is empty

or specified timeout elapses before an item is added to the queue.

Return type

hazelcast.future.Future[any]

size()

Transactional implementation of Queue.size()

Returns

Size of the queue.

Return type

hazelcast.future.Future[int]