Hi there,
After reading some of the source code, I figured out that this might be a
better minimal example for raising and receiving events in ryu:
---
import gevent
from ryu.base import app_manager
from ryu.controller import event
from ryu.controller.handler import set_ev_cls
TEST_EVENT_E
But I still cannot see the 'recv: xxx' as expected, here are the outputs:
-
loading app ryu.controller.ofp_handler
loading app event.py
instantiating app ryu.controller.ofp_handler
instantiating app event.py
-
and nothing more.
2013/3/1 OHMURA Kei
> 2013/3/1 can. :
> > What I want is a
2013/3/1 can. :
> Thanks Kei,
>
> You mean a normal app does not need to call that method explicitly? And what
> that method is supposed to do?
Yes.
bin/ryu-manager.py creates Ryu app instance. Please see it.
Thanks,
>
>
> 2013/3/1 OHMURA Kei
>>
>> 2013/3/1 can. :
>> > I think I get it. I shoul
Thanks Kei,
You mean a normal app does not need to call that method explicitly? And
what that method is supposed to do?
2013/3/1 OHMURA Kei
> 2013/3/1 can. :
> > I think I get it. I should add ` self.register_observer(EventTest,
> > self.name) ` in TestEvent.__init__(). Thanks very much!
> > A
2013/3/1 can. :
> I think I get it. I should add ` self.register_observer(EventTest,
> self.name) ` in TestEvent.__init__(). Thanks very much!
> And I also see register_handler() in class RyuApp, when should I use it?
IIUC, your app don't need to use it.
Thanks,
>
>
> 2013/3/1 can.
>>
>> But I
I think I get it. I should add ` self.register_observer(EventTest, self.name)
` in TestEvent.__init__(). Thanks very much!
And I also see register_handler() in class RyuApp, when should I use it?
2013/3/1 can.
> But I still cannot see the 'recv: xxx' as expected, here are the outputs:
> -
>
hi,
> I tried what you said, as:
> -
> class Event_1(event.EventBase):
> def __init__(self):
> super(Event_1, self).__init__()
> self.msg = 'event 1'
>
> class Hehe(app_manager.RyuApp):
> def __init__(self):
> super(Hehe, self).__init__()
> self.registe
I tried what you said, as:
-
class Event_1(event.EventBase):
def __init__(self):
super(Event_1, self).__init__()
self.msg = 'event 1'
class Hehe(app_manager.RyuApp):
def __init__(self):
super(Hehe, self).__init__()
self.register_observer(Event_1, self.na
2013/3/1 can. :
> What I want is a minimal example of handling event, including:
> 1) define an event
> 2) send an event
> 3) receive an event
The following code would help your understanding?
--
import gevent
from ryu.base import app_manager
from ryu.controller import event
from ryu.controller.
What I want is a minimal example of handling event, including:
1) define an event
2) send an event
3) receive an event
2013/2/28 Isaku Yamahata
> On Thu, Feb 28, 2013 at 04:13:36PM +0800, can. wrote:
> > Hi there,
> >
> > I'm trying to figure out ryu's event mechanism by sending and receiving
>
On Thu, Feb 28, 2013 at 04:13:36PM +0800, can. wrote:
> Hi there,
>
> I'm trying to figure out ryu's event mechanism by sending and receiving an
> event. Below is the test code I wrote:
> -
> from ryu.base import app_manager
> from ryu.controller import event, handler
>
> class Hehe(app_m
On Thu, 28 Feb 2013 16:13:36 +0800
"can." wrote:
> Hi there,
>
> I'm trying to figure out ryu's event mechanism by sending and receiving an
> event. Below is the test code I wrote:
> -
> from ryu.base import app_manager
> from ryu.controller import event, handler
>
> class Hehe(app_mana
12 matches
Mail list logo