Hi,

On 2015年07月23日 16:18, Vinllen Chen wrote:
> Hi, Dear all:
> 
> I want to create a new thread/coroutine in RYU app, i find it's not ok to 
> write the code below:
> 
> class App(app_manager.RyuApp) :
>     def __init__(self, *args, **kwargs):
>         ...
>         hub.spawn(New_One())

What messages did you get?

hub.spawn() is defined as follow.
https://github.com/osrg/ryu/blob/master/ryu/lib/hub.py#L47

e.g.)
  from ryu.lib import hub
  ...
  class YourApp(app_manager.RyuApp) :
      def __init__(self, *args, **kwargs):
          ...
          hub.spawn(self.target_func)

      def target_func(self):
          ...

Thanks,
Iwase

> 
> -- 
> Best Regards,
> Vinllen
> 
> 
> ------------------------------------------------------------------------------
> 
> 
> 
> _______________________________________________
> Ryu-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ryu-devel
> 

------------------------------------------------------------------------------
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to