Dears

It may be a strange a question but I am facing a problem to run Ryu in
parallel with an other synchronization program.
That's why I am wondering how to lanch Ryu application from a thread call.
I tried the fellowing code but I got the bellow errors.

Please advise me how shall I proceed ?
Thanks in advance.
Regards
-------
Code:

from subprocess import call
import thread
import time

from ryu.cmd.manager import *
#from bin import *

# Define a function for the 2nd thread
def print_time(threadName):
        count = 0
    delay = 3
        while 1:#count < 5:
            count += 1
            print "%s: %s" % (threadName, time.ctime(time.time()) )
            time.sleep(delay)


try:
    thread1 = thread.start_new_thread( main,
("/home/ubuntu/Documents/simpleSwitchv0.py", ) )
    thread2 = thread.start_new_thread( print_time, ("Thread-2", ) )

except:
        print "Error: unable to start thread"

while 1:
        pass


---------------------
Errors:
Thread-2: Mon Jan 11 15:10:48 2016
loading app /
Unhandled exception in thread started by <function main at 0x7ff8f5bda230>
Traceback (most recent call last):
  File "/home/ubuntu/ryu/ryu/cmd/manager.py", line 88, in main
    app_mgr.load_apps(app_lists)
  File "/home/ubuntu/ryu/ryu/base/app_manager.py", line 574, in load_apps
    cls = self.load_app(app_cls_name)
  File "/home/ubuntu/ryu/ryu/base/app_manager.py", line 550, in load_app
    mod = utils.import_module(name)
  File "/home/ubuntu/ryu/ryu/utils.py", line 91, in import_module
    __import__(name)
ValueError: Empty module name
Thread-2: Mon Jan 11 15:10:51 2016
^CTraceback (most recent call last):
  File "callRyu.py", line 37, in <module>
    pass
KeyboardInterrupt
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to