From 37fed5c76494ff7762d347fd854b9b1df7cedb9b Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Mon, 10 Feb 2014 14:26:33 +0900 Subject: handler.register_service: comment Signed-off-by: YAMAMOTO Takashi Signed-off-by: FUJITA Tomonori --- ryu/controller/handler.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ryu/controller/handler.py b/ryu/controller/handler.py index d5f57cda..43f07d1a 100644 --- a/ryu/controller/handler.py +++ b/ryu/controller/handler.py @@ -80,6 +80,17 @@ def get_dependent_services(cls): def register_service(service): + """ + Register the ryu application specified by 'service' as + a provider of events defined in the calling module. + + If an application being loaded consumes events (in the sense of + set_ev_cls) provided by the 'service' application, the latter + application will be automatically loaded. + + This mechanism is used to e.g. automatically start ofp_handler if + there are applications consuming OFP events. + """ frm = inspect.stack()[1] m = inspect.getmodule(frm[0]) m._SERVICE_NAME = service -- cgit v1.2.3