Class: Kaal::Dispatch::Registry
- Inherits:
-
Object
- Object
- Kaal::Dispatch::Registry
- Defined in:
- lib/kaal/dispatch/registry.rb
Overview
Base abstraction for dispatch audit logging.
Provides a pluggable interface for logging cron job dispatch attempts across different storage backends (memory, Redis, database, etc.).
Direct Known Subclasses
DatabaseEngine, MemoryEngine, RedisEngine, Internal::ActiveRecord::DispatchRegistry
Instance Method Summary collapse
-
#dispatched?(key, fire_time) ⇒ Boolean
Check if a dispatch has been logged for a specific job and fire time.
-
#find_dispatch(_key, _fire_time) ⇒ Hash?
Find a dispatch record for a specific job and fire time.
-
#log_dispatch(_key, _fire_time, _node_id, _status = 'dispatched') ⇒ void
Log a dispatch attempt for a cron job.
Instance Method Details
#dispatched?(key, fire_time) ⇒ Boolean
Check if a dispatch has been logged for a specific job and fire time.
56 57 58 |
# File 'lib/kaal/dispatch/registry.rb', line 56 def dispatched?(key, fire_time) find_dispatch(key, fire_time) ? true : false end |
#find_dispatch(_key, _fire_time) ⇒ Hash?
Find a dispatch record for a specific job and fire time.
46 47 48 |
# File 'lib/kaal/dispatch/registry.rb', line 46 def find_dispatch(_key, _fire_time) raise NotImplementedError, "#{self.class.name} must implement #find_dispatch" end |
#log_dispatch(_key, _fire_time, _node_id, _status = 'dispatched') ⇒ void
This method returns an undefined value.
Log a dispatch attempt for a cron job.
35 36 37 |
# File 'lib/kaal/dispatch/registry.rb', line 35 def log_dispatch(_key, _fire_time, _node_id, _status = 'dispatched') raise NotImplementedError, "#{self.class.name} must implement #log_dispatch" end |