Class: Mindee::Input::PollingOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/mindee/input/polling_options.rb

Overview

Options for asynchronous polling.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(initial_delay_sec: 2.0, delay_sec: 1.5, max_retries: 80) ⇒ PollingOptions

Returns a new instance of PollingOptions.

Parameters:

  • initial_delay_sec (Float) (defaults to: 2.0)

    Initial delay before the first attempt (default:2.0).

  • delay_sec (Float) (defaults to: 1.5)

    Delay between attempts (default: 1.5).

  • max_retries (Integer) (defaults to: 80)

    Maximum number of retries (default:80).



19
20
21
22
23
# File 'lib/mindee/input/polling_options.rb', line 19

def initialize(initial_delay_sec: 2.0, delay_sec: 1.5, max_retries: 80)
  @initial_delay_sec = initial_delay_sec
  @delay_sec = delay_sec
  @max_retries = max_retries
end

Instance Attribute Details

#delay_secInteger, Float (readonly)

Returns Delay between each polling attempt (in seconds).

Returns:

  • (Integer, Float)

    Delay between each polling attempt (in seconds).



11
12
13
# File 'lib/mindee/input/polling_options.rb', line 11

def delay_sec
  @delay_sec
end

#initial_delay_secInteger, Float (readonly)

Returns Initial delay before the first polling attempt (in seconds).

Returns:

  • (Integer, Float)

    Initial delay before the first polling attempt (in seconds).



8
9
10
# File 'lib/mindee/input/polling_options.rb', line 8

def initial_delay_sec
  @initial_delay_sec
end

#max_retriesInteger (readonly)

Returns Total number of polling attempts.

Returns:

  • (Integer)

    Total number of polling attempts.



14
15
16
# File 'lib/mindee/input/polling_options.rb', line 14

def max_retries
  @max_retries
end