On Wed, 30 Jan 2013 09:46:08 +0900 (JST)
FUJITA Tomonori <[email protected]> wrote:

> On Tue, 29 Jan 2013 12:18:58 +0900
> Isaku Yamahata <[email protected]> wrote:
> 
>> On Mon, Jan 21, 2013 at 12:31:28PM +0900, FUJITA Tomonori wrote:
>>> This is purely internal change and no API for applications is
>>> changed. At least, I confirmed that folsom OpenStack plugin works.
>>> 
>>> With the current dispatcher mechanism, multiple greenlets call
>>> applications' handlers and might be blocked anywhere so we need
>>> various locks to handle that concurrency. This makes things difficult
>>> for application developers.
>>> 
>>> With this patch, each software components are connected with events.
>>> Each component has the own greenlet(s) to handle events and might send
>>> events to other components.
>>> 
>>> For the compatibility, currently RyuApp class instances are converted
>>> into the above components. If an application registers handlers for
>>> some OF events, it subscribes to OF component and registers the OF
>>> events that it's interested. OF component delivers such OF events to
>>> the application and the application's greenlet executes the handlers.
>>> 
>>> With this, we can completely remove dispatcher.py and its friends.
>>> 
>>> Signed-off-by: FUJITA Tomonori <[email protected]>
>>> ---
>>>  ryu/base/app_manager.py       |   75 
>>> +++++++++++++++++++++++++++++++++-------
>>>  ryu/controller/controller.py  |   36 ++++++++++----------
>>>  ryu/controller/dpset.py       |   31 ++++++-----------
>>>  ryu/controller/handler.py     |   43 +++++++++++------------
>>>  ryu/controller/ofp_event.py   |    6 +++
>>>  ryu/controller/ofp_handler.py |   21 ++++++-----
>>>  6 files changed, 129 insertions(+), 83 deletions(-)
>>> 
>>> diff --git a/ryu/base/app_manager.py b/ryu/base/app_manager.py
>>> index 4a29c95..eedae11 100644
>>> --- a/ryu/base/app_manager.py
>>> +++ b/ryu/base/app_manager.py
>>> @@ -17,6 +17,9 @@
>>>  import inspect
>>>  import itertools
>>>  import logging
>>> +import gevent
>>> +
>>> +from gevent.queue import Queue
>>>  
>>>  from ryu import utils
>>>  from ryu.controller.handler import register_instance
>>> @@ -24,20 +27,13 @@ from ryu.controller.controller import Datapath
>>>  
>>>  LOG = logging.getLogger('ryu.base.app_manager')
>>>  
>>> +SERVICE_BRICKS = {}
>>>  
>>> -class RyuAppContext(object):
>>> -    """
>>> -    Base class for Ryu application context
>>> -    """
>>> -    def __init__(self):
>>> -        super(RyuAppContext, self).__init__()
>>>  
>>> -    def close(self):
>>> -        """
>>> -        teardown method
>>> -        The method name, close, is chosen for python context manager
>>> -        """
>>> -        pass
>>> +def lookup_service_brick(name):
>>> +    if name in SERVICE_BRICKS:
>>> +        return SERVICE_BRICKS[name]
>>> +    return None
>> 
>>        return SERVICE_BRIDGE.get(name)
> 
> Fixed.

Applied the updated patch.

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to