public final class RemoteObservables<T>
extends java.lang.Object
RemoteObservable
and send data through it
//Example to send RemoteObservables for send events for "Download"
//return to client
RemoteObservable <Integer > remoteObservable = RemoteObservables. <Integer >of("Download").newObservable();
//notify all clients
RemoteObservables. <Integer >of("Download")
.onNext(50)
.onNext(100)
.onCompleted();
Modifier and Type | Method and Description |
---|---|
RemoteObservable<T> |
newObservable()
Creates a new
RemoteObservable to return to client
By default this observable will emit every data that is send using onNext(Object) |
RemoteObservable<T> |
newObservable(boolean ignoreDuplicates)
Creates a new
RemoteObservable to return to client. |
static <T> RemoteObservables<T> |
of(java.lang.Object type)
Returns
RemoteObservables tied to the given type |
RemoteObservables<T> |
onCompleted()
Notify all clients that this observable has completed
|
RemoteObservables<T> |
onError(java.lang.Exception exception)
Notify all clients of error
|
RemoteObservables<T> |
onNext(T data)
Send the given data to all clients that created using
newObservable() |
public static <T> RemoteObservables<T> of(java.lang.Object type)
RemoteObservables
tied to the given typepublic RemoteObservable<T> newObservable()
RemoteObservable
to return to client
By default this observable will emit every data that is send using onNext(Object)
RemoteObservable
to return to clientpublic RemoteObservable<T> newObservable(boolean ignoreDuplicates)
RemoteObservable
to return to client.
To send data use onNext(Object)
ignoreDuplicates
- Whether this observable to ignore duplicates send to itRemoteObservable
to return to clientpublic RemoteObservables<T> onNext(T data)
newObservable()
data
- data to sendpublic RemoteObservables<T> onCompleted()
public RemoteObservables<T> onError(java.lang.Exception exception)