Commit 63304cb9 authored by Antoine Millet's avatar Antoine Millet

Added create_watcher method on Protocol

parent 2ff6d1cc
......@@ -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.
"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment