class Riffer::Rig::Runtime::Job
Attributes
command
[R]
String
id
[R]
String
@dynamic id, pid, command, output_path, started_at, offset
offset
[R]
Integer
output_path
[R]
String
pid
[R]
Integer
started_at
[R]
Float
Public Class Methods
(id: String, pid: Integer, command: String, output_path: String, started_at: Float, ?ended_at: Float?, ?offset: Integer) → void
Source
# File lib/riffer/rig/runtime/job.rb, line 28 def initialize(id:, pid:, command:, output_path:, started_at:, ended_at: nil, offset: 0) @id = id @pid = pid @command = command @output_path = output_path @started_at = started_at @ended_at = ended_at @offset = offset freeze end
@rbs id: String @rbs pid: Integer @rbs command: String @rbs output_path: String @rbs started_at: Float @rbs ended_at: Float? @rbs offset: Integer @rbs return: void
Public Instance Methods
() → bool
Source
# File lib/riffer/rig/runtime/job.rb, line 40 def active? @ended_at.nil? end
@rbs return: bool
(Integer bytes) → Riffer::Rig::Runtime::Job
Source
# File lib/riffer/rig/runtime/job.rb, line 63 def advance(bytes) copy(offset: offset + bytes) end
@rbs bytes: Integer @rbs return: Riffer::Rig::Runtime::Job
() → bool
Source
# File lib/riffer/rig/runtime/job.rb, line 45 def completed? !@ended_at.nil? end
@rbs return: bool
(Float now) → Float
Source
# File lib/riffer/rig/runtime/job.rb, line 51 def elapsed(now) (@ended_at || now) - @started_at end
@rbs now: Float @rbs return: Float
(Float ended_at) → Riffer::Rig::Runtime::Job
Source
# File lib/riffer/rig/runtime/job.rb, line 57 def finish(ended_at) copy(ended_at: ended_at) end
@rbs ended_at: Float @rbs return: Riffer::Rig::Runtime::Job