public final class QueuingBroadcaster extends AbstractBroadcaster
next
Constructor and Description |
---|
QueuingBroadcaster(Broadcaster broadcaster)
Creates a new
QueuingBroadcaster and calls AbstractBroadcaster.chain(Broadcaster) on this instance, passing in the
given Broadcaster . |
Modifier and Type | Method and Description |
---|---|
Iterable<Broadcastable> |
all()
Gets a a view of all items in the queue.
|
void |
broadcast(Broadcastable broadcastable)
Broadcasts the given event (syntax unit).
|
QueuingBroadcaster |
pause()
Pauses the queue.
|
Broadcastable |
peek()
Retrieves, but does not remove the first item in the queue.
|
Broadcastable |
peekLast()
Retrieves, but does not remove the last item in the queue.
|
QueuingBroadcaster |
reject(Broadcastable broadcastable)
Prevents the given
Broadcastable unit, if it currently exists in the queue, from being broadcasted once resume() is called. |
QueuingBroadcaster |
resume()
Resumes broadcasts.
|
int |
size()
Gets the count of the items currently in the queue.
|
chain, chainBroadcast, cut, relay
public QueuingBroadcaster(Broadcaster broadcaster)
QueuingBroadcaster
and calls AbstractBroadcaster.chain(Broadcaster)
on this instance, passing in the
given Broadcaster
.broadcaster
- Add this broadcaster to the end of the chain. This will receive all broadcasts when the queue is not paused or when it
resumes.public void broadcast(Broadcastable broadcastable)
Broadcaster
broadcastable
- The Broadcastable
syntax unit.public QueuingBroadcaster pause()
resume()
is called.public QueuingBroadcaster resume()
public int size()
public Broadcastable peek()
public Broadcastable peekLast()
public Iterable<Broadcastable> all()
public QueuingBroadcaster reject(Broadcastable broadcastable)
Broadcastable
unit, if it currently exists in the queue, from being broadcasted once resume()
is called.broadcastable
- The Broadcastable
unit to reject.Copyright (c) 2019, Salesforce.com, Inc. All rights reserved. Licensed under the BSD 3-Clause license. For full license text, see the LICENSE file in the repository.