cc.youchain.protocol.websocket.WebSocketSubscription Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core Show documentation
Show all versions of core Show documentation
YOUChain Common library in JAVA.
package cc.youchain.protocol.websocket;
import io.reactivex.subjects.BehaviorSubject;
/**
* Objects necessary to process a new item received via a WebSocket subscription.
*
* @param type of a data item that should be returned by a WebSocket subscription.
*/
public class WebSocketSubscription {
private BehaviorSubject subject;
private Class responseType;
/**
* Creates WebSocketSubscription.
*
* @param subject used to send new data items to listeners
* @param responseType type of a data item returned by a WebSocket subscription
*/
public WebSocketSubscription(BehaviorSubject subject, Class responseType) {
this.subject = subject;
this.responseType = responseType;
}
public BehaviorSubject getSubject() {
return subject;
}
public Class getResponseType() {
return responseType;
}
}