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

Added create_watcher method on Protocol

parent 2ff6d1cc
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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.
        """