Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7117 48e7efb5...
[simgrid.git] / src / bindings / ruby / Slave_old.rb
1 require 'msg'
2 require 'RubyProcess'
3 require 'RubyTask'
4 include MSG
5
6 class Slave < RbProcess
7   
8   def initialize()
9     super()
10   end
11   
12   def msg_main(args)
13     info("Hello From Slave")
14   end
15   
16  # msg_main : that function that will be executed when Running Simulation
17   def msg_main(args)
18     info("Hello From Slave")
19     while true
20         
21        task = RbTask.get(); #by default Port set to 0
22        task_name = RbTask.name(task)
23        puts "my name ........" + task_name
24       if ( task_name == "finalize" )
25         puts "Received finalize msg"
26         break
27       end
28        puts "Processing..." + RbTask.name(task)
29        RbTask.execute(task)
30     end
31     puts "I'm Done ... See You !!"
32     break
33     end
34     
35     
36   end
37