Class: TaskJuggler::JobInfo

Inherits:
Object show all
Defined in:
lib/taskjuggler/BatchProcessor.rb

Overview

The JobInfo class is just a storage container for some batch job related pieces of information. It contains things like a job id, the process id, the stdout data and the like.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(jobId, block, tag) ⇒ JobInfo

Returns a new instance of JobInfo.



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/taskjuggler/BatchProcessor.rb', line 28

def initialize(jobId, block, tag)
  # The job id. A unique number that is used by the BatchProcessor objects
  # to indentify jobs.
  @jobId = jobId
  # This the the block of code to be run as external process.
  @block = block
  # The tag can really be anything that the user of BatchProcessor needs
  # to uniquely identify the job.
  @tag = tag
  # The pipe to transfer stdout data from the child to the parent.
  @stdoutP, @stdoutC = nil
  # The stdout output of the child
  @stdout = ''
  # This flag is set to true when the EOT character has been received.
  @stdoutEOF = false
  # The pipe to transfer stderr data from the child to the parent.
  @stderrP, @stderrC = nil
  # The stderr output of the child
  @stderr = ''
  # This flag is set to true when the EOT character has been received.
  @stderrEOT = false
end

Instance Attribute Details

#blockObject (readonly)

Returns the value of attribute block.



24
25
26
# File 'lib/taskjuggler/BatchProcessor.rb', line 24

def block
  @block
end

#jobIdObject (readonly)

Returns the value of attribute jobId.



24
25
26
# File 'lib/taskjuggler/BatchProcessor.rb', line 24

def jobId
  @jobId
end

#pidObject

Returns the value of attribute pid.



25
26
27
# File 'lib/taskjuggler/BatchProcessor.rb', line 25

def pid
  @pid
end

#retValObject

Returns the value of attribute retVal.



25
26
27
# File 'lib/taskjuggler/BatchProcessor.rb', line 25

def retVal
  @retVal
end

#stderrObject

Returns the value of attribute stderr.



25
26
27
# File 'lib/taskjuggler/BatchProcessor.rb', line 25

def stderr
  @stderr
end

#stderrCObject

Returns the value of attribute stderrC.



25
26
27
# File 'lib/taskjuggler/BatchProcessor.rb', line 25

def stderrC
  @stderrC
end

#stderrEOTObject

Returns the value of attribute stderrEOT.



25
26
27
# File 'lib/taskjuggler/BatchProcessor.rb', line 25

def stderrEOT
  @stderrEOT
end

#stderrPObject

Returns the value of attribute stderrP.



25
26
27
# File 'lib/taskjuggler/BatchProcessor.rb', line 25

def stderrP
  @stderrP
end

#stdoutObject

Returns the value of attribute stdout.



25
26
27
# File 'lib/taskjuggler/BatchProcessor.rb', line 25

def stdout
  @stdout
end

#stdoutCObject

Returns the value of attribute stdoutC.



25
26
27
# File 'lib/taskjuggler/BatchProcessor.rb', line 25

def stdoutC
  @stdoutC
end

#stdoutEOTObject

Returns the value of attribute stdoutEOT.



25
26
27
# File 'lib/taskjuggler/BatchProcessor.rb', line 25

def stdoutEOT
  @stdoutEOT
end

#stdoutPObject

Returns the value of attribute stdoutP.



25
26
27
# File 'lib/taskjuggler/BatchProcessor.rb', line 25

def stdoutP
  @stdoutP
end

#tagObject (readonly)

Returns the value of attribute tag.



24
25
26
# File 'lib/taskjuggler/BatchProcessor.rb', line 24

def tag
  @tag
end

Instance Method Details

#openPipesObject



51
52
53
54
# File 'lib/taskjuggler/BatchProcessor.rb', line 51

def openPipes
  @stdoutP, @stdoutC = IO.pipe
  @stderrP, @stderrC = IO.pipe
end