Class: Legion::Extensions::Actors::Loop
- Inherits:
-
Object
- Object
- Legion::Extensions::Actors::Loop
- Includes:
- Concurrent::Async, Base
- Defined in:
- lib/legion/extensions/actors/loop.rb
Constant Summary
Constants included from Helpers::Base
Helpers::Base::NAMESPACE_BOUNDARIES
Instance Method Summary collapse
- #action(**_opts) ⇒ Object
- #cancel ⇒ Object
-
#initialize ⇒ Loop
constructor
A new instance of Loop.
- #run ⇒ Object
Methods included from Base
#args, #check_subtask?, #enabled?, #function, #generate_task?, included, #manual, #remote_invocable?, #runner, #use_runner?
Methods included from Dsl
Methods included from Helpers::Lex
#default_settings, included, #runner_desc
Methods included from Helpers::Base
#actor_class, #actor_const, #actor_name, #amqp_prefix, #calling_class, #calling_class_array, #from_json, #full_path, #lex_class, #lex_const, #lex_name, #lex_slug, #log_tag, #normalize, #runner_class, #runner_const, #runner_name, #segments, #settings_path, #table_prefix, #to_dotted_hash
Methods included from Helpers::Task
#generate_task_id, #generate_task_log, #task_update
Methods included from Helpers::Logger
Methods included from Helpers::Secret
reset_identity!, resolve_identity!, #secret
Methods included from Helpers::Core
Constructor Details
#initialize ⇒ Loop
Returns a new instance of Loop.
12 13 14 15 16 17 |
# File 'lib/legion/extensions/actors/loop.rb', line 12 def initialize @loop = true async.run rescue StandardError => e handle_exception(e) end |
Instance Method Details
#action(**_opts) ⇒ Object
23 24 25 |
# File 'lib/legion/extensions/actors/loop.rb', line 23 def action(**_opts) Legion::Logging.warn 'An extension is using the default action for a loop' end |
#cancel ⇒ Object
27 28 29 |
# File 'lib/legion/extensions/actors/loop.rb', line 27 def cancel @loop = false end |
#run ⇒ Object
19 20 21 |
# File 'lib/legion/extensions/actors/loop.rb', line 19 def run action while @loop end |