public class MemoryChannel<T> extends Object implements Channel<T>
Constructor and Description |
---|
MemoryChannel() |
Modifier and Type | Method and Description |
---|---|
void |
clearSubscribers() |
void |
publish(T s)
Publish a message.
|
Disposable |
subscribe(DisposingExecutor queue,
Callback<T> onReceive)
Subscribe to receive messages produced by this subscriber
|
Disposable |
subscribe(Subscribable<T> sub) |
Disposable |
subscribeOnProducerThread(DisposingExecutor queue,
Callback<T> callbackOnQueue) |
int |
subscriberCount() |
public int subscriberCount()
public Disposable subscribe(DisposingExecutor queue, Callback<T> onReceive)
Subscriber
subscribe
in interface Subscriber<T>
queue
- DisposingExecutor
to use for invoking the callback upon message receipt.onReceive
- Callback
to invoke upon message receiptDisposable
that can be invoked to cancel this subscriptionpublic Disposable subscribe(Subscribable<T> sub)
subscribe
in interface Subscriber<T>
public Disposable subscribeOnProducerThread(DisposingExecutor queue, Callback<T> callbackOnQueue)
public void clearSubscribers()
Copyright © 2017. All Rights Reserved.