summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIsaku Yamahata <yamahata@valinux.co.jp>2013-04-04 12:28:04 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2013-04-07 11:11:16 +0900
commit48b2665795615920b8aec583f62bd097eb656fb5 (patch)
treebac6470cd81071513f53b3b8dfec33f17a0c8bd1
parentd763da58bc6afaddcade0883b3b25244c1e55f62 (diff)
ryu/base/app_manager: introduce RyuApp:replay_to_request()
This is a handy method for event request/reply. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/base/app_manager.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/ryu/base/app_manager.py b/ryu/base/app_manager.py
index ab6175ac..53419cfc 100644
--- a/ryu/base/app_manager.py
+++ b/ryu/base/app_manager.py
@@ -123,6 +123,13 @@ class RyuApp(object):
for observer in self.get_observers(ev, state):
self.send_event(observer, ev)
+ def reply_to_request(self, req, rep):
+ rep.dst = req.src
+ if req.sync:
+ self.send_reply(rep)
+ else:
+ self.send_event(rep.dst, rep)
+
def close(self):
"""
teardown method.