Class: Hanami::Events::CloudPubsub::CLI::Commands::Run
- Inherits:
-
CLI::Command
- Object
- CLI::Command
- Hanami::Events::CloudPubsub::CLI::Commands::Run
- Defined in:
- lib/hanami/events/cloud_pubsub/cli.rb
Overview
Command to run the worker
Instance Attribute Summary collapse
-
#runner ⇒ Object
readonly
Returns the value of attribute runner.
Instance Method Summary collapse
- #call(opts) ⇒ Object
-
#initialize(*args) ⇒ Run
constructor
A new instance of Run.
Constructor Details
#initialize(*args) ⇒ Run
Returns a new instance of Run.
17 18 19 20 |
# File 'lib/hanami/events/cloud_pubsub/cli.rb', line 17 def initialize(*args) super @event_queue = Queue.new end |
Instance Attribute Details
#runner ⇒ Object (readonly)
Returns the value of attribute runner.
15 16 17 |
# File 'lib/hanami/events/cloud_pubsub/cli.rb', line 15 def runner @runner end |
Instance Method Details
#call(opts) ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/hanami/events/cloud_pubsub/cli.rb', line 32 def call(opts) setup_env(opts) parse_opts(opts) load_config build_runner load_subscriptions setup_signal_handlers start_runner start_server sleep_forever end |