Beispiel #1
0
    def rawlink(self, callback):
        """Register a callable to be executed when the greenlet finishes the execution.

        WARNING: the callable will be called in the HUB greenlet.
        """
        if not callable(callback):
            raise TypeError('Expected callable: %r' % (callback, ))
        self._links.append(callback)
        if self.ready() and not self._notifier.active:
            self._notifier.start(self._notify_links)
Beispiel #2
0
    def rawlink(self, callback):
        """Register a callable to be executed when the greenlet finishes the execution.

        WARNING: the callable will be called in the HUB greenlet.
        """
        if not callable(callback):
            raise TypeError('Expected callable: %r' % (callback, ))
        self._links.append(callback)
        if self.ready() and not self._notifier.active:
            self._notifier.start(self._notify_links)
Beispiel #3
0
 def __init__(self, callback):
     if not callable(callback):
         raise TypeError("Expected callable: %r" % (callback, ))
     self.callback = callback
Beispiel #4
0
 def __init__(self, callback):
     if not callable(callback):
         raise TypeError("Expected callable: %r" % (callback, ))
     self.callback = callback