Class: Sidekiq::Tasks::Storage::Base
- Inherits:
-
Object
- Object
- Sidekiq::Tasks::Storage::Base
- Defined in:
- lib/sidekiq/tasks/storage/base.rb
Direct Known Subclasses
Constant Summary collapse
- ERROR_MESSAGE_MAX_LENGTH =
255
Instance Attribute Summary collapse
-
#history_limit ⇒ Object
readonly
Returns the value of attribute history_limit.
-
#task_name ⇒ Object
readonly
Returns the value of attribute task_name.
Instance Method Summary collapse
-
#history ⇒ Array<Hash>
abstract
Returns the execution history for the task.
-
#initialize(task_name, history_limit: nil) ⇒ Base
constructor
A new instance of Base.
-
#last_enqueue_at ⇒ Time, NilClass
abstract
Returns the last enqueue time for the task.
-
#store_enqueue(_jid, _args, user: nil) ⇒ Object
abstract
Stores enqueue information for the task.
-
#store_execution(_jid, _time_key) ⇒ Object
abstract
Stores execution time for a specific history entry.
-
#store_execution_error(_jid, _error) ⇒ Object
abstract
Stores an execution error for a specific history entry.
Constructor Details
#initialize(task_name, history_limit: nil) ⇒ Base
Returns a new instance of Base.
9 10 11 12 |
# File 'lib/sidekiq/tasks/storage/base.rb', line 9 def initialize(task_name, history_limit: nil) @task_name = task_name @history_limit = history_limit end |
Instance Attribute Details
#history_limit ⇒ Object (readonly)
Returns the value of attribute history_limit.
7 8 9 |
# File 'lib/sidekiq/tasks/storage/base.rb', line 7 def history_limit @history_limit end |
#task_name ⇒ Object (readonly)
Returns the value of attribute task_name.
7 8 9 |
# File 'lib/sidekiq/tasks/storage/base.rb', line 7 def task_name @task_name end |
Instance Method Details
#history ⇒ Array<Hash>
Subclasses must implement this method.
Returns the execution history for the task.
28 29 30 |
# File 'lib/sidekiq/tasks/storage/base.rb', line 28 def history raise NotImplementedError, "Storage must implement #history" end |
#last_enqueue_at ⇒ Time, NilClass
Subclasses must implement this method.
Returns the last enqueue time for the task.
19 20 21 |
# File 'lib/sidekiq/tasks/storage/base.rb', line 19 def last_enqueue_at raise NotImplementedError, "Storage must implement #last_enqueue_at" end |
#store_enqueue(_jid, _args, user: nil) ⇒ Object
Subclasses must implement this method.
Stores enqueue information for the task.
39 40 41 |
# File 'lib/sidekiq/tasks/storage/base.rb', line 39 def store_enqueue(_jid, _args, user: nil) raise NotImplementedError, "Storage must implement #store_enqueue" end |
#store_execution(_jid, _time_key) ⇒ Object
Subclasses must implement this method.
Stores execution time for a specific history entry.
49 50 51 |
# File 'lib/sidekiq/tasks/storage/base.rb', line 49 def store_execution(_jid, _time_key) raise NotImplementedError, "Storage must implement #store_execution" end |
#store_execution_error(_jid, _error) ⇒ Object
Subclasses must implement this method.
Stores an execution error for a specific history entry.
59 60 61 |
# File 'lib/sidekiq/tasks/storage/base.rb', line 59 def store_execution_error(_jid, _error) raise NotImplementedError, "Storage must implement #store_execution_error" end |