Class OkexStreamingExchange

java.lang.Object
org.knowm.xchange.BaseExchange
org.knowm.xchange.okex.OkexExchange
info.bitrich.xchangestream.okex.OkexStreamingExchange
All Implemented Interfaces:
StreamingExchange, Exchange

public class OkexStreamingExchange extends OkexExchange implements StreamingExchange
  • Field Details

  • Constructor Details

    • OkexStreamingExchange

      public OkexStreamingExchange()
  • Method Details

    • connect

      public io.reactivex.rxjava3.core.Completable connect(ProductSubscription... args)
      Description copied from interface: StreamingExchange
      Connects to the WebSocket API of the exchange.
      Specified by:
      connect in interface StreamingExchange
      Parameters:
      args - Product subscription is used only in certain exchanges where you need to specify subscriptions during the connect phase.
      Returns:
      Completable that completes upon successful connection.
    • disconnect

      public io.reactivex.rxjava3.core.Completable disconnect()
      Description copied from interface: StreamingExchange
      Disconnect from the WebSocket API.
      Specified by:
      disconnect in interface StreamingExchange
      Returns:
      Completable that completes upon successful disconnect.
    • isAlive

      public boolean isAlive()
      Description copied from interface: StreamingExchange
      Checks whether connection to the exchange is alive.
      Specified by:
      isAlive in interface StreamingExchange
      Returns:
      true if connection is open, otherwise false.
    • getStreamingMarketDataService

      public StreamingMarketDataService getStreamingMarketDataService()
      Description copied from interface: StreamingExchange
      Returns service that can be used to access streaming market data.
      Specified by:
      getStreamingMarketDataService in interface StreamingExchange
    • getStreamingTradeService

      public StreamingTradeService getStreamingTradeService()
      Description copied from interface: StreamingExchange
      Returns service that can be used to access streaming trade data.
      Specified by:
      getStreamingTradeService in interface StreamingExchange
    • useCompressedMessages

      public void useCompressedMessages(boolean compressedMessages)
      Description copied from interface: StreamingExchange
      Set whether or not to enable compression handler.
      Specified by:
      useCompressedMessages in interface StreamingExchange
      Parameters:
      compressedMessages - Defaults to false
    • setChannelInactiveHandler

      public void setChannelInactiveHandler(WebSocketClientHandler.WebSocketMessageHandler channelInactiveHandler)
      Enables the user to listen on channel inactive events and react appropriately.
      Parameters:
      channelInactiveHandler - a WebSocketMessageHandler instance.