Class: Fairy::CJunction

Inherits:
CIOFilter show all
Defined in:
lib/fairy/master/c-junction.rb

Defined Under Namespace

Classes: PortQueue

Instance Attribute Summary

Attributes inherited from CIOFilter

#input

Attributes included from CInputtable

#input

Instance Method Summary collapse

Methods inherited from CIOFilter

#node_class, #output=

Methods included from CInputtable

#break_running, #inputtable?

Methods inherited from CFilter

#abort_create_node, #add_node, #assgin_number_of_nodes?, #bind_export, #break_create_node, #break_running, #create_and_add_node, #create_import, #create_node, #create_nodes, #def_job_pool_variable, #each_export_by, #each_node, #each_node_exist_only, #handle_exception, #input, #job_pool_dict, #job_pool_variable, #njob_creation_params, #node_class_name, #nodes, #number_of_nodes, #number_of_nodes=, #pool_dict, #postmapping_policy, #start_create_nodes, #start_export, #start_watch_node_status, #update_status, watch_status, watch_status=, #watch_status?

Constructor Details

#initialize(controller, opts) ⇒ CJunction

Returns a new instance of CJunction.



14
15
16
17
# File 'lib/fairy/master/c-junction.rb', line 14

def initialize(controller, opts)
  super
  @port_queue = PortQueue.new
end

Instance Method Details

#each_assigned_filter(&block) ⇒ Object



34
35
36
37
38
39
# File 'lib/fairy/master/c-junction.rb', line 34

def each_assigned_filter(&block)
  for input_filter in @port_queue
#Log::debugf(self, "%s %s", exp.to_s, node.to_s)
	block.call input_filter
  end
end

#input=(input) ⇒ Object



19
20
21
22
# File 'lib/fairy/master/c-junction.rb', line 19

def input=(input)
  @input = input
  start
end

#startObject



24
25
26
27
28
29
30
31
32
# File 'lib/fairy/master/c-junction.rb', line 24

def start
  Log::debug self, "START CONNECTING: #{self}"
  Thread.start do
	@input.each_assigned_filter do |input_filter|
	  @port_queue.push input_filter
	end
	@port_queue.push nil
  end
end