X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/bdc1e4dcf3ddc4c5b8556c99cb1b84ae47924914..e0b3c9e46ab80798ec9606a853a1af9cb818a758:/src/bindings/ruby/Slave.rb diff --git a/src/bindings/ruby/Slave.rb b/src/bindings/ruby/Slave.rb index 07e848e32f..e85da1f0ac 100644 --- a/src/bindings/ruby/Slave.rb +++ b/src/bindings/ruby/Slave.rb @@ -9,26 +9,34 @@ class Slave < RbProcess super() end + #for Testing + def msg_main2(args) + info("Hello From Slave") + end + + + + + # msg_main : that function that will be executed when Running Simulation def msg_main(args) - puts "Hello From Slave" + info("Hello From Slave") s_mailbox = "slave>>" + args[0] + while true - - p "Hellow...................here3 "+s_mailbox - task = RbTask.receive(s_mailbox) - task_name = RbTask.name(task) - if ( task_name == "finalize" ) - puts "Slave" + s_mailbox + "got finalize msg" + + info("Ready to Receive Task") + task = RbTask.receive(s_mailbox) + task_name = RbTask.name(task) + info ("Task Received : " + task_name) + if (task_name == "finalize") + info("Slave" + s_mailbox + "got finalize msg") break end - puts "Slave " + s_mailbox + "Processing" + RbTask.name(task) - RbTask.execute(task) + info("Slave " + s_mailbox + " ...Processing" + RbTask.name(task)) + RbTask.execute(task) end - puts "Slave " + s_mailbox + "I'm Done , See You !!" + info("Slave " + s_mailbox + "I'm Done , See You !!") end end - - -# slave = Slave.new \ No newline at end of file