Sha256: da063a77caf7091039fae2db132c55e225199fd55e166d421057239ea52fe948

Contents?: true

Size: 407 Bytes

Versions: 19

Compression:

Stored size: 407 Bytes

Contents

class ShutdownManager

  def initialize(args)
    @protocol = args.fetch(:protocol)
    @job_state = args.fetch(:job_state)
  end

  def cancel_job
    @protocol.cancel_job if @protocol
  ensure
    cancel_job_state
  end

  private

  def cancel_job_state
    @job_state.cancel if @job_state
  ensure
    disconnect_protocol
  end

  def disconnect_protocol
    @protocol.disconnect if @protocol
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
gorgon-0.11.0 lib/gorgon/shutdown_manager.rb
gorgon-0.10.5 lib/gorgon/shutdown_manager.rb
gorgon-0.10.4 lib/gorgon/shutdown_manager.rb
gorgon-0.10.3 lib/gorgon/shutdown_manager.rb
gorgon-0.10.2 lib/gorgon/shutdown_manager.rb
gorgon-0.10.1 lib/gorgon/shutdown_manager.rb
gorgon-0.10.0 lib/gorgon/shutdown_manager.rb
gorgon-0.9.0 lib/gorgon/shutdown_manager.rb
gorgon-0.8.4 lib/gorgon/shutdown_manager.rb
gorgon-0.8.3 lib/gorgon/shutdown_manager.rb
gorgon-0.8.2 lib/gorgon/shutdown_manager.rb
gorgon-0.8.1 lib/gorgon/shutdown_manager.rb
gorgon-0.8.0 lib/gorgon/shutdown_manager.rb
gorgon-0.7.1 lib/gorgon/shutdown_manager.rb
gorgon-0.7.0 lib/gorgon/shutdown_manager.rb
gorgon-0.7.0.rc4 lib/gorgon/shutdown_manager.rb
gorgon-0.7.0.rc3 lib/gorgon/shutdown_manager.rb
gorgon-0.7.0.rc2 lib/gorgon/shutdown_manager.rb
gorgon-0.7.0.rc1 lib/gorgon/shutdown_manager.rb