From 63304cb93714301498a657bffd7ae977384aaa14 Mon Sep 17 00:00:00 2001 From: Antoine Millet Date: Tue, 11 Sep 2012 17:08:04 +0200 Subject: [PATCH] Added create_watcher method on Protocol --- sjrpc/core/protocols/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sjrpc/core/protocols/__init__.py b/sjrpc/core/protocols/__init__.py index d9ee83a..5a27658 100644 --- a/sjrpc/core/protocols/__init__.py +++ b/sjrpc/core/protocols/__init__.py @@ -43,6 +43,13 @@ class Protocol(object): """ return self._label + def create_watcher(self, watcher_class, **kwargs): + """ Create a new pyev watcher for this protocol and return it. + """ + kwargs['loop'] = self._connection.loop + watcher = watcher_class(**kwargs) + return watcher + def send(self, payload): """ Send a message through the sjRpc connection. """ -- GitLab