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

com.github.twitch4j.common.pool.TransactionalSubscriber Maven / Gradle / Ivy

There is a newer version: 1.23.0
Show newest version
package com.github.twitch4j.common.pool;

/**
 * Generic interface for objects that can respond to a subscription request, S,
 * with a response, T, which can later be used for unsubscription to yield U.
 *
 * @param  subscription request
 * @param  transactional response to the subscription request that can be used as an unsubscription request
 * @param  unsubscription response
 */
public interface TransactionalSubscriber {

    /**
     * Submits a subscription request.
     *
     * @param s the subscription request
     * @return a response to the request
     */
    T subscribe(S s);

    /**
     * Submits an unsubscription request.
     *
     * @param t the unsubscription request
     * @return a response to the request
     */
    U unsubscribe(T t);

}