To  whom it may concern,

      I try to generate a self-defined event in Ryu. What I have done shows 
below,
      1. define a xxx_event.py and define a EventXXXX in this file.
      2. In a Ryu app, import xxx_event. Call the 
self.send_event_to_observers(ev, self.state)
      3. In another Ryu app,  decorated a method by 
@set_ev_handler(xxx_event.EventXXXX, state)


      However, I run the apps and return nothing.
      I really generate a event which defined by me, and call the 
method:send_event_to_observers.
      I found that the observers of my event is empty, so the event can't be 
pushed in the Queue.
      
      How should I do to register the observer? 
      
      If I add the code below to call handles, the event will be handled, 
because I handle the event directly.


        dispatchers = lambda x: x.callers[ev.__class__].dispatchers
        handlers = [handler for handler in
                    self.oxp_brick.get_handlers(ev) if
                    MAIN_DISPATCHER in dispatchers(handler)]
        for handler in handlers:
            handler(ev)





      Thanks for your time.
      I look forward to your reply.


      Best Regards.


------------------
Distance ????
_____________________________________________________
School of Information and Communication Engineering
Beijing University of Posts and Telecommunications
Beijing 100876, PR China

??????????????????????????????????????????
_____________________________________________________
Mobile Phone: 
(+86) 151-1698-3550 Beijing 
E-mail:
[email protected]
[email protected]
Homepage:
http://www.muzixing.com
------------------------------------------------------------------------------
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to