Class: RbEAI::PutTask

Inherits:
IOTask show all
Defined in:
lib/rbeai/TasksLogic.rb

Instance Attribute Summary

Attributes inherited from IOTask

#files, #location, #pattern, #rate

Attributes inherited from Task

#name, #nextTask, #size, #status, #wflow

Instance Method Summary collapse

Methods inherited from Task

#persist, #persistFtp, #persistStr

Constructor Details

#initialize(wflow, xmlFull, xmlDoc) ⇒ PutTask

Returns a new instance of PutTask.



252
253
254
255
# File 'lib/rbeai/TasksLogic.rb', line 252

def initialize(wflow, xmlFull, xmlDoc)    
  super(wflow, xmlFull, xmlDoc)
  @logic = PutLogic.new(xmlDoc, self)    
end

Instance Method Details

#doBuffered(buffer) ⇒ Object



272
273
274
275
276
277
278
279
280
281
# File 'lib/rbeai/TasksLogic.rb', line 272

def doBuffered(buffer)        
  buffer.size.times do
    obj = buffer.deq        
    if @rate.to_i != 0
      print "Send doBuffered #{obj} > #{location}\n"
      @logic.putFile(obj)
      sleep(@rate.to_i)
    end
  end    
end

#doJob(resultQueue, obj) ⇒ Object



258
259
260
261
262
263
264
265
266
# File 'lib/rbeai/TasksLogic.rb', line 258

def doJob(resultQueue, obj)    
  if @rate.to_i != 0
    super(resultQueue, obj)    
  else 
    print "Send doJob #{obj} > #{location}\n"
    @logic.putFile(obj)
    resultQueue.enq(obj)        
  end
end

#getItemsNext(numItems) ⇒ Object



268
269
270
# File 'lib/rbeai/TasksLogic.rb', line 268

def getItemsNext(numItems)
  return numItems
end