Class ConnectableService
java.lang.Object
info.bitrich.xchangestream.service.ConnectableService
- Direct Known Subclasses:
NettyStreamingService
Base class of streaming services, declares connect() method including before connection logic
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionio.reactivex.rxjava3.core.Completable
connect()
protected abstract io.reactivex.rxjava3.core.Completable
void
setBeforeConnectionHandler
(Runnable beforeConnectionHandler)
-
Field Details
-
BEFORE_CONNECTION_HANDLER
Exchange specific parameter is used for providingRunnable
action which is caused before setup new connection. For example adding throttle control for limiting too often opening connections:static final TimedSemaphore limiter = new TimedSemaphore(1, MINUTES, 15); ExchangeSpecification spec = exchange.getDefaultExchangeSpecification(); spec.setExchangeSpecificParameters(ImmutableMap.of( {@link ConnectableService#BEFORE_CONNECTION_HANDLER}, () -> limiter.acquire() ));
- See Also:
-
-
Constructor Details
-
ConnectableService
public ConnectableService()
-
-
Method Details
-
setBeforeConnectionHandler
-
openConnection
protected abstract io.reactivex.rxjava3.core.Completable openConnection() -
connect
public io.reactivex.rxjava3.core.Completable connect()
-