Class: Ace::Hitl::CLI::Commands::Consume

Inherits:
Support::Cli::Command
  • Object
show all
Includes:
LifecycleCommand, Support::Cli::Base
Defined in:
lib/ace/hitl/cli/commands/consume.rb

Overview

Requester-side answer consumption. A positive timeout bounds ONLY the local wait and never cancels the request (W651); without it the wait is indefinite (spec 8wm.t.y21 §3).

Constant Summary

Constants included from LifecycleCommand

LifecycleCommand::STDIN_READER

Instance Method Summary collapse

Methods included from LifecycleCommand

#emit, #lifecycle_store, #overseer, #raise_lifecycle_error

Instance Method Details

#call(id:, **options) ⇒ Object



25
26
27
28
29
# File 'lib/ace/hitl/cli/commands/consume.rb', line 25

def call(id:, **options)
  emit(lifecycle_store.consume(id, timeout: options[:timeout] || 0))
rescue Lifecycle::Error => e
  raise_lifecycle_error(e.message)
end