Class: Karafka::Web::Pro::Commanding::Handlers::Partitions::Commands::Pause
- Inherits:
-
Base
- Object
- Base
- Karafka::Web::Pro::Commanding::Handlers::Partitions::Commands::Pause
- Defined in:
- lib/karafka/web/pro/commanding/handlers/partitions/commands/pause.rb
Overview
Executes the pause request to pause (or prolong) partition
Instance Method Summary collapse
-
#call ⇒ Object
Triggers pausing of a given topic partition or updates the pause.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Karafka::Web::Pro::Commanding::Handlers::Partitions::Commands::Base
Instance Method Details
#call ⇒ Object
Triggers pausing of a given topic partition or updates the pause
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/karafka/web/pro/commanding/handlers/partitions/commands/pause.rb', line 46 def call # If pause is already there and we don't want to change the way it is, we skip if coordinator.pause_tracker.paused? && request[:prevent_override] result("prevented") return end duration = request[:duration] duration = FOREVER_MS if duration.zero? coordinator.pause_tracker.pause(duration) client.pause(topic, partition_id, nil, duration) result("applied") end |