T
- Data type for the Topicpublic class Topic<T> extends java.lang.Object implements Adapter<T>
Constructor and Description |
---|
Topic()
Construct a new Topic
|
Topic(Queue<T> q)
Construct a Topic using the Queue provided
|
Modifier and Type | Method and Description |
---|---|
boolean |
close()
Close this Topic
|
void |
disconnect(java.util.stream.Stream<T> stream)
Topic will maintain a queue for each Subscribing Stream
If a Stream is finished with a Topic it is good practice to disconnect from the Topic
so messages will no longer be stored for that Stream
|
boolean |
fromStream(java.util.stream.Stream<T> stream) |
Signal<java.lang.Integer> |
getSizeSignal(int index) |
boolean |
offer(T data)
Add a single datapoint to this Queue
|
void |
setSizeSignal(int index,
Signal<java.lang.Integer> s) |
ReactiveSeq<T> |
stream()
Generating a stream will register the Stream as a subscriber to this topic.
|
ReactiveSeq<T> |
stream(Continueable s) |
ReactiveSeq<java.util.concurrent.CompletableFuture<T>> |
streamCompletableFutures()
Generating a streamCompletableFutures will register the Stream as a subscriber to this topic.
|
<R> R |
visit(java.util.function.Function<? super Queue<T>,? extends R> caseQueue,
java.util.function.Function<? super Topic<T>,? extends R> caseTopic)
Conditionally execute one of the supplied function depending on whether or not this Adapter is a Queue or a Topic
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
futureStream, futureStream, matches
public void disconnect(java.util.stream.Stream<T> stream)
stream
- public boolean fromStream(java.util.stream.Stream<T> stream)
fromStream
in interface Adapter<T>
stream
- Input data from provided Streampublic ReactiveSeq<java.util.concurrent.CompletableFuture<T>> streamCompletableFutures()
streamCompletableFutures
in interface Adapter<T>
public ReactiveSeq<T> stream()
public ReactiveSeq<T> stream(Continueable s)
public boolean close()
public Signal<java.lang.Integer> getSizeSignal(int index)
public void setSizeSignal(int index, Signal<java.lang.Integer> s)
public boolean offer(T data)
public <R> R visit(java.util.function.Function<? super Queue<T>,? extends R> caseQueue, java.util.function.Function<? super Topic<T>,? extends R> caseTopic)
Adapter