public class Ether<T> implements IDataPublisher<T>, IDataObservable<T>
Ether is a PubSub data bus where data can be published and subscribed.
| Modifier and Type | Class and Description |
|---|---|
static class |
Ether.Companion |
| Modifier and Type | Field and Description |
|---|---|
static Ether.Companion |
Companion |
| Constructor and Description |
|---|
Ether()
Ether is a PubSub data bus where data can be published and subscribed.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
clear()
Clear all the publishers and subscribers
|
void |
publish(T data)
Publishes the data of type T to
class Ether |
static <T> IDataPublisher<T> |
publisherOf(java.lang.Class<T> type)
Returns an
interface IDataPublisher for type T |
void |
subscribe(IDataSubscriber<T> subscriber)
Subscribe for the data of type T send to
class Ether |
static <T> IDataObservable<T> |
subscriberOf(java.lang.Class<T> type)
Returns an
interface IDataObservable for type T |
void |
unsubscribe(IDataSubscriber<T> subscriber)
Removes the subscription if any
|
publishsubscribe, unsubscribepublic static Ether.Companion Companion
public Ether()
Ether is a PubSub data bus where data can be published and subscribed.
public void publish(T data)
Publishes the data of type T to class Ether
class Etherpublic void subscribe(IDataSubscriber<T> subscriber)
Subscribe for the data of type T send to class Ether
class Etherpublic void unsubscribe(IDataSubscriber<T> subscriber)
Removes the subscription if any
public static <T> IDataPublisher<T> publisherOf(java.lang.Class<T> type)
Returns an interface IDataPublisher for type T
interface IDataPublisherpublic static <T> IDataObservable<T> subscriberOf(java.lang.Class<T> type)
Returns an interface IDataObservable for type T
interface IDataObservablepublic static void clear()
Clear all the publishers and subscribers