Class BitmexStreamingService
java.lang.Object
info.bitrich.xchangestream.service.ConnectableService
info.bitrich.xchangestream.service.netty.NettyStreamingService<com.fasterxml.jackson.databind.JsonNode>
info.bitrich.xchangestream.service.netty.JsonNettyStreamingService
info.bitrich.xchangestream.bitmex.BitmexStreamingService
Created by Lukas Zaoralek on 13.11.17.
-
Nested Class Summary
Nested classes/interfaces inherited from class info.bitrich.xchangestream.service.netty.NettyStreamingService
NettyStreamingService.NettyWebSocketClientHandler, NettyStreamingService.Subscription
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
Fields inherited from class info.bitrich.xchangestream.service.netty.JsonNettyStreamingService
objectMapper
Fields inherited from class info.bitrich.xchangestream.service.netty.NettyStreamingService
channels, DEFAULT_CONNECTION_TIMEOUT, DEFAULT_IDLE_TIMEOUT, DEFAULT_RETRY_DURATION, uri
Fields inherited from class info.bitrich.xchangestream.service.ConnectableService
BEFORE_CONNECTION_HANDLER
-
Constructor Summary
ConstructorDescriptionBitmexStreamingService
(String apiUrl, String apiKey, String secretKey) BitmexStreamingService
(String apiUrl, String apiKey, String secretKey, int maxFramePayloadLength, Duration connectionTimeout, Duration retryDuration, int idleTimeoutSeconds) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addDelayEmitter
(io.reactivex.rxjava3.core.ObservableEmitter<Long> delayEmitter) io.reactivex.rxjava3.core.Completable
connect()
void
void
enableDeadMansSwitch
(long rate, long timeout) protected String
getChannelNameFromMessage
(com.fasterxml.jackson.databind.JsonNode message) protected io.netty.handler.codec.http.DefaultHttpHeaders
getSubscribeMessage
(String channelName, Object... args) getUnsubscribeMessage
(String channelName, Object... args) protected io.netty.handler.codec.http.websocketx.extensions.WebSocketClientExtensionHandler
protected void
handleMessage
(com.fasterxml.jackson.databind.JsonNode message) boolean
io.reactivex.rxjava3.core.Observable<BitmexWebSocketTransaction>
subscribeBitmexChannel
(String channelName) Methods inherited from class info.bitrich.xchangestream.service.netty.JsonNettyStreamingService
messageHandler, processArrayMessageSeparately, sendObjectMessage
Methods inherited from class info.bitrich.xchangestream.service.netty.NettyStreamingService
disconnect, getChannel, getSubscriptionUniqueId, getWebSocketClientHandler, handleChannelError, handleChannelMessage, handleError, handleIdle, isSocketOpen, openConnection, resubscribeChannels, sendMessage, setAcceptAllCertificates, setAutoReconnect, setEnableLoggingHandler, setLoggingHandlerLevel, setSocksProxyHost, setSocksProxyPort, subscribeChannel, subscribeConnectionState, subscribeConnectionSuccess, subscribeDisconnect, subscribeIdle, subscribeReconnectFailure, useCompressedMessages
Methods inherited from class info.bitrich.xchangestream.service.ConnectableService
setBeforeConnectionHandler
-
Field Details
-
DMS_CANCEL_ALL_IN
public static final int DMS_CANCEL_ALL_IN- See Also:
-
DMS_RESUBSCRIBE
public static final int DMS_RESUBSCRIBE- See Also:
-
-
Constructor Details
-
BitmexStreamingService
-
BitmexStreamingService
-
-
Method Details
-
connect
public io.reactivex.rxjava3.core.Completable connect()- Overrides:
connect
in classConnectableService
-
handleMessage
protected void handleMessage(com.fasterxml.jackson.databind.JsonNode message) - Overrides:
handleMessage
in classNettyStreamingService<com.fasterxml.jackson.databind.JsonNode>
-
getWebSocketClientExtensionHandler
protected io.netty.handler.codec.http.websocketx.extensions.WebSocketClientExtensionHandler getWebSocketClientExtensionHandler()- Overrides:
getWebSocketClientExtensionHandler
in classNettyStreamingService<com.fasterxml.jackson.databind.JsonNode>
-
subscribeBitmexChannel
public io.reactivex.rxjava3.core.Observable<BitmexWebSocketTransaction> subscribeBitmexChannel(String channelName) -
getCustomHeaders
protected io.netty.handler.codec.http.DefaultHttpHeaders getCustomHeaders()- Overrides:
getCustomHeaders
in classNettyStreamingService<com.fasterxml.jackson.databind.JsonNode>
-
getChannelNameFromMessage
protected String getChannelNameFromMessage(com.fasterxml.jackson.databind.JsonNode message) throws IOException - Specified by:
getChannelNameFromMessage
in classNettyStreamingService<com.fasterxml.jackson.databind.JsonNode>
- Throws:
IOException
-
getSubscribeMessage
- Specified by:
getSubscribeMessage
in classNettyStreamingService<com.fasterxml.jackson.databind.JsonNode>
- Throws:
IOException
-
getUnsubscribeMessage
- Specified by:
getUnsubscribeMessage
in classNettyStreamingService<com.fasterxml.jackson.databind.JsonNode>
- Throws:
IOException
-
enableDeadMansSwitch
- Throws:
IOException
-
disableDeadMansSwitch
- Throws:
IOException
-
isDeadMansSwitchEnabled
public boolean isDeadMansSwitchEnabled() -
addDelayEmitter
-