Class StreamingDataSourceBuilder

    • Field Detail

      • backgroundPollIntervalMillis

        protected int backgroundPollIntervalMillis
      • initialReconnectDelayMillis

        protected int initialReconnectDelayMillis
      • streamEvenInBackground

        protected boolean streamEvenInBackground
    • Constructor Detail

      • StreamingDataSourceBuilder

        public StreamingDataSourceBuilder()
    • Method Detail

      • initialReconnectDelayMillis

        public StreamingDataSourceBuilder initialReconnectDelayMillis​(int initialReconnectDelayMillis)
        Sets the initial reconnect delay for the streaming connection.

        The streaming service uses a backoff algorithm (with jitter) every time the connection needs to be reestablished. The delay for the first reconnection will start near this value, and then increase exponentially for any subsequent connection failures.

        The default value is DEFAULT_INITIAL_RECONNECT_DELAY_MILLIS.

        Parameters:
        initialReconnectDelayMillis - the reconnect time base value in milliseconds
        Returns:
        the builder
      • streamEvenInBackground

        public StreamingDataSourceBuilder streamEvenInBackground​(boolean streamEvenInBackground)
        Sets whether streaming should be used even if the application is in the background.

        By default, this option is false, meaning that if the application is in the background then the SDK will turn off the stream connection and use infrequent polling, until the application is in the foreground again.

        If you set this option to true, the SDK will continue to use the stream connection regardless of foreground/background state. Use this option with caution, since normally it is preferable to limit network usage by backgrounded applications.

        Parameters:
        streamEvenInBackground - true if streaming should be used even in the background
        Returns:
        the builder
        Since:
        3.4.0