Class: Temporalio::Worker::PollerBehavior::Autoscaling

Inherits:
Temporalio::Worker::PollerBehavior show all
Defined in:
lib/temporalio/worker/poller_behavior.rb

Overview

A poller behavior that automatically scales the number of pollers based on feedback from the server. A slot must be available before beginning polling.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(minimum: 1, maximum: 100, initial: 5) ⇒ Autoscaling

Returns a new instance of Autoscaling.

Parameters:

  • minimum (Integer) (defaults to: 1)

    Minimum number of poll calls (assuming slots are available).

  • maximum (Integer) (defaults to: 100)

    Maximum number of poll calls that will ever be open at once.

  • initial (Integer) (defaults to: 5)

    Number of polls attempted initially before scaling kicks in.



43
44
45
46
47
48
# File 'lib/temporalio/worker/poller_behavior.rb', line 43

def initialize(minimum: 1, maximum: 100, initial: 5)
  super()
  @minimum = minimum
  @maximum = maximum
  @initial = initial
end

Instance Attribute Details

#initialInteger (readonly)

Returns Number of polls attempted initially before scaling kicks in.

Returns:

  • (Integer)

    Number of polls attempted initially before scaling kicks in.



38
39
40
# File 'lib/temporalio/worker/poller_behavior.rb', line 38

def initial
  @initial
end

#maximumInteger (readonly)

Returns Maximum number of poll calls that will ever be open at once.

Returns:

  • (Integer)

    Maximum number of poll calls that will ever be open at once.



36
37
38
# File 'lib/temporalio/worker/poller_behavior.rb', line 36

def maximum
  @maximum
end

#minimumInteger (readonly)

Returns Minimum number of poll calls (assuming slots are available).

Returns:

  • (Integer)

    Minimum number of poll calls (assuming slots are available).



34
35
36
# File 'lib/temporalio/worker/poller_behavior.rb', line 34

def minimum
  @minimum
end