Module: ActiveJob::Temporal::SignalQueryOptions::ClassMethods
- Defined in:
- lib/activejob/temporal/signal_query_options.rb
Instance Method Summary collapse
- #temporal_query(name, &block) ⇒ Object
- #temporal_query_handler_names ⇒ Object
- #temporal_query_handlers ⇒ Object
- #temporal_signal(name, &block) ⇒ Object
- #temporal_signal_handler_names ⇒ Object
- #temporal_signal_handlers ⇒ Object
- #temporal_update(name, &block) ⇒ Object
- #temporal_update_handler_names ⇒ Object
- #temporal_update_handlers ⇒ Object
Instance Method Details
#temporal_query(name, &block) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/activejob/temporal/signal_query_options.rb', line 23 def temporal_query(name, &block) raise ArgumentError, "temporal_query requires a block" unless block handler_name = normalize_handler_name(name) validate_custom_handler_name!(handler_name, "query", BUILT_IN_QUERY_NAMES) local_temporal_query_handlers[handler_name] = block end |
#temporal_query_handler_names ⇒ Object
55 56 57 |
# File 'lib/activejob/temporal/signal_query_options.rb', line 55 def temporal_query_handler_names temporal_query_handlers.keys end |
#temporal_query_handlers ⇒ Object
43 44 45 |
# File 'lib/activejob/temporal/signal_query_options.rb', line 43 def temporal_query_handlers inherited_temporal_handlers(:temporal_query_handlers).merge(local_temporal_query_handlers) end |
#temporal_signal(name, &block) ⇒ Object
17 18 19 20 21 |
# File 'lib/activejob/temporal/signal_query_options.rb', line 17 def temporal_signal(name, &block) handler_name = normalize_handler_name(name) validate_custom_handler_name!(handler_name, "signal", BUILT_IN_SIGNAL_NAMES) local_temporal_signal_handlers[handler_name] = block || default_signal_handler(handler_name) end |
#temporal_signal_handler_names ⇒ Object
51 52 53 |
# File 'lib/activejob/temporal/signal_query_options.rb', line 51 def temporal_signal_handler_names temporal_signal_handlers.keys end |
#temporal_signal_handlers ⇒ Object
39 40 41 |
# File 'lib/activejob/temporal/signal_query_options.rb', line 39 def temporal_signal_handlers inherited_temporal_handlers(:temporal_signal_handlers).merge(local_temporal_signal_handlers) end |
#temporal_update(name, &block) ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/activejob/temporal/signal_query_options.rb', line 31 def temporal_update(name, &block) raise ArgumentError, "temporal_update requires a block" unless block handler_name = normalize_handler_name(name) validate_custom_handler_name!(handler_name, "update", BUILT_IN_UPDATE_NAMES) local_temporal_update_handlers[handler_name] = block end |
#temporal_update_handler_names ⇒ Object
59 60 61 |
# File 'lib/activejob/temporal/signal_query_options.rb', line 59 def temporal_update_handler_names temporal_update_handlers.keys end |
#temporal_update_handlers ⇒ Object
47 48 49 |
# File 'lib/activejob/temporal/signal_query_options.rb', line 47 def temporal_update_handlers inherited_temporal_handlers(:temporal_update_handlers).merge(local_temporal_update_handlers) end |