Module: Forked

Defined in:
lib/forked/with_graceful_shutdown.rb,
lib/forked.rb,
lib/forked/worker.rb,
lib/forked/version.rb,
lib/forked/process_manager.rb,
lib/forked/retry_strategies/always.rb,
lib/forked/retry_strategies/exponential_backoff.rb,
lib/forked/retry_strategies/exponential_backoff_with_limit.rb

Overview

Traps SIGTERM and SIGINT and shuts down only when the block is called, allowing for graceful shutdown.

Examples:

WithGracefulShutdown.run do |ready_to_stop|
  loop do
    # do some work
    ready_to_stop.call
  end
end
WithGracefulShutdown.loop(sleep_seconds: 2) do |ready_to_stop|
  print '.'
end

Defined Under Namespace

Modules: RetryStrategies Classes: ProcessManager, WithGracefulShutdown, Worker

Constant Summary collapse

VERSION =
"0.1.4"