final class FutureQueue[A] extends AnyRef
A queue which returns Futures for elements which may not have been enqueued yet.
- A
the type of the contents of this queue
- Alphabetic
- By Inheritance
- FutureQueue
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
++=(xs: TraversableOnce[A]): FutureQueue.this.type
Append elements to this queue.
Append elements to this queue.
- xs
the elements to append
- returns
this queue
-
def
+=(a: A): FutureQueue.this.type
Append an element to this queue.
Append an element to this queue.
- a
the element to append
- returns
this queue
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
dequeue(): Future[A]
Returns a Future containing the next element, and removes that element from this queue.
Returns a Future containing the next element, and removes that element from this queue. If this queue contains no elements, the Future will be completed when more elements are added to the queue; an element is said to be "promised" by that Future. Futures returned by this method are completed by enqueued elements in the order that the elements were promised.
- returns
Returns a Future (eventually) containing the next element in this queue
-
def
drainContinually[B](f: (A) ⇒ B)(implicit executor: ExecutionContext): Unit
Dequeues elements from this queue as they are added, and applies them to the specified function.
Dequeues elements from this queue as they are added, and applies them to the specified function.
One SHOULD NOT dequeue elements from this queue after calling this method or drainContinuallyTo; doing so will result in only some elements being applied to the specified function, in an inconsistent fashion. For the same reason, neither this method nor drainContinuallyTo (nor FutureQueue.aggregate with
this
as an argument) should be invoked after calling this method.- B
only used to accept any return type from the callback function
- f
a function executed with each element added to this queue (forever); its return value is ignored
- executor
the ExecutionContext used to execute the callbacks
-
def
drainContinuallyTo[B >: A](other: FutureQueue[B])(implicit executor: ExecutionContext): Unit
Dequeues elements from this queue as they are added, and enqueues them to the specified
FutureQueue
.Dequeues elements from this queue as they are added, and enqueues them to the specified
FutureQueue
.One SHOULD NOT dequeue elements from this queue after calling this method or drainContinually; doing so will result in only some elements being enqueued to the specified queue, in an inconsistent fashion. For the same reason, neither this method nor drainContinually (nor FutureQueue.aggregate with
this
as an argument) should be invoked after calling this method.- B
the type of the elements in the other queue
- other
the queue to which to enqueue elements added to this queue
- executor
the ExecutionContext used to enqueue elements to the other queue
- Annotations
- @throws( ... )
- Exceptions thrown
IllegalArgumentException
if the specifiedFutureQueue
isthis
-
def
enqueue(xs: A*): Unit
Append elements to this queue.
Append elements to this queue.
- xs
the elements to append
-
def
enqueue(a: A): Unit
Append an element to this queue.
Append an element to this queue.
- a
the element to append
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(other: Any): Boolean
Returns
true
ifthis
andother
are equal.Returns
true
ifthis
andother
are equal.this
andother
are equal only ifother
is aFutureQueue
, and theFutureQueue
s are equal. TwoFutureQueue
s are equal if they have the same queued elements, and no promised elements.- other
the other object
- returns
true
ifthis
andother
are equal;false
otherwise
- Definition Classes
- FutureQueue → AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- FutureQueue → AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
promiseCount: Int
Returns the number of elements promised by dequeue which have not yet been completed.
Returns the number of elements promised by dequeue which have not yet been completed.
- returns
the number of promised elements in this queue
-
def
queued: Queue[A]
Returns the elements currently in this queue.
Returns the elements currently in this queue. Returns an empty Queue if there are no elements or promised elements in this queue.
- returns
the elements currently in the queue
-
def
size: Int
Returns the size of this queue.
Returns the size of this queue. Returns a negative number if there are no elements queued and there are promised elements which are not completed.
- returns
the size of this queue
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- FutureQueue → AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
Deprecated Value Members
-
def
drainToContinually[B >: A](other: FutureQueue[B])(implicit executor: ExecutionContext): Unit
- Annotations
- @deprecated
- Deprecated
(Since version 1.2.0) use
drainContinuallyTo
instead- See also
-
def
enqueue(xs: TraversableOnce[A]): Unit
Append elements to this queue.
Append elements to this queue.
- xs
the elements to append
- Annotations
- @deprecated
- Deprecated
(Since version 1.2.0) use
enqueue(A*)
or++=
instead