All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cc.youchain.protocol.websocket.WebSocketSubscription Maven / Gradle / Ivy

There is a newer version: 1.1.5
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy