Class: MediaMonster::Job
Instance Attribute Summary collapse
-
#call_back ⇒ Object
url for webhook.
-
#job_type ⇒ Object
which type of job is this? audio to start, video, document, etc.
-
#original ⇒ Object
file location.
-
#priority ⇒ Object
Now supports a numeric value.
-
#retry_delay ⇒ Object
Returns the value of attribute retry_delay.
-
#retry_max ⇒ Object
for retry logic, you can set a number of times to retry (retry_max) and how long to wait before try in seconds (retry_delay).
-
#tasks ⇒ Object
array of tasks.
Attributes inherited from Model
Instance Method Summary collapse
- #add_sequence(*args) {|new_sequence| ... } ⇒ Object
- #add_task(*args) ⇒ Object
-
#initialize(*args) ⇒ Job
constructor
A new instance of Job.
- #retry! ⇒ Object
Methods inherited from Model
#as_json_with_class_name, #to_json
Constructor Details
#initialize(*args) ⇒ Job
Returns a new instance of Job.
16 17 18 19 |
# File 'lib/media_monster/job.rb', line 16 def initialize(*args) super @tasks = [] end |
Instance Attribute Details
#call_back ⇒ Object
url for webhook
8 9 10 |
# File 'lib/media_monster/job.rb', line 8 def call_back @call_back end |
#job_type ⇒ Object
which type of job is this? audio to start, video, document, etc.
6 7 8 |
# File 'lib/media_monster/job.rb', line 6 def job_type @job_type end |
#original ⇒ Object
file location
7 8 9 |
# File 'lib/media_monster/job.rb', line 7 def original @original end |
#priority ⇒ Object
Now supports a numeric value
5 6 7 |
# File 'lib/media_monster/job.rb', line 5 def priority @priority end |
#retry_delay ⇒ Object
Returns the value of attribute retry_delay.
14 15 16 |
# File 'lib/media_monster/job.rb', line 14 def retry_delay @retry_delay end |
#retry_max ⇒ Object
for retry logic, you can set a number of times to retry (retry_max) and how long to wait before try in seconds (retry_delay)
13 14 15 |
# File 'lib/media_monster/job.rb', line 13 def retry_max @retry_max end |
#tasks ⇒ Object
array of tasks
9 10 11 |
# File 'lib/media_monster/job.rb', line 9 def tasks @tasks end |
Instance Method Details
#add_sequence(*args) {|new_sequence| ... } ⇒ Object
30 31 32 33 34 |
# File 'lib/media_monster/job.rb', line 30 def add_sequence(*args) new_sequence = Sequence.new @tasks << new_sequence yield new_sequence end |
#add_task(*args) ⇒ Object
36 37 38 39 40 41 42 43 44 |
# File 'lib/media_monster/job.rb', line 36 def add_task(*args) @tasks ||= [] new_task = if (args.length == 1 && args[0].is_a?(MediaMonster::Task)) args[0] else MediaMonster::Task.new(*args) end @tasks << new_task end |
#retry! ⇒ Object
46 47 48 |
# File 'lib/media_monster/job.rb', line 46 def retry! MediaMonsterClient.retry_job self end |