Class: Async::Runner::Command
- Inherits:
-
Samovar::Command
- Object
- Samovar::Command
- Async::Runner::Command
- Defined in:
- lib/async/runner/command.rb
Constant Summary collapse
- MAX_FIBERS =
1000
Instance Method Summary collapse
-
#call ⇒ Object
Prepare the environment and invoke the sub-command.
-
#container_class ⇒ Object
The container class to use.
- #container_options ⇒ Object
- #job_class ⇒ Object
-
#quiet? ⇒ Boolean
Whether quiet logging was enabled.
-
#verbose? ⇒ Boolean
Whether verbose logging is enabled.
Instance Method Details
#call ⇒ Object
Prepare the environment and invoke the sub-command.
66 67 68 69 70 71 72 73 74 |
# File 'lib/async/runner/command.rb', line 66 def call if [:version] puts "#{self.name} v#{Async::Runner::VERSION}" elsif [:help] self.print_usage else run end end |
#container_class ⇒ Object
The container class to use.
77 78 79 80 81 82 83 84 85 86 |
# File 'lib/async/runner/command.rb', line 77 def container_class case [:container] when :threaded return Async::Container::Threaded when :forked return Async::Container::Forked when :hybrid return Async::Container::Hybrid end end |
#container_options ⇒ Object
88 89 90 91 92 93 94 |
# File 'lib/async/runner/command.rb', line 88 def if [:container] == :hybrid .slice(:count, :forks, :threads, :name, :restart, :key) else .slice(:count, :name, :restart, :key) end end |
#job_class ⇒ Object
96 97 98 |
# File 'lib/async/runner/command.rb', line 96 def job_class Async::Runner::Job end |
#quiet? ⇒ Boolean
Whether quiet logging was enabled.
61 62 63 |
# File 'lib/async/runner/command.rb', line 61 def quiet? [:logging] == :quiet end |
#verbose? ⇒ Boolean
Whether verbose logging is enabled.
55 56 57 |
# File 'lib/async/runner/command.rb', line 55 def verbose? [:logging] == :verbose end |