How to use the pebble.thread.task function in Pebble

To help you get started, we’ve selected a few Pebble examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github noxdafox / pebble / tests / test_thread_task.py View on Github external
@thread.task(callback=callback)
def long_decorated_callback():
    time.sleep(1)
github noxdafox / pebble / tests / test_thread_task.py View on Github external
def test_undecorated_results(self):
        """Thread Task undecorated results are produced."""
        task = thread.task(target=undecorated, args=[1],
                           kwargs={'keyword_argument': 1})
        self.assertEqual(task.get(), 2)
github noxdafox / pebble / tests / test_thread_task.py View on Github external
            @thread.task(5, name='foo')
            def wrong():
                return
        except Exception as error:
github noxdafox / pebble / tests / test_thread_task.py View on Github external
    @thread.task
    def instmethod(self):
        return self.b
github noxdafox / pebble / tests / test_thread_task.py View on Github external
@thread.task
def error_decorated():
    raise Exception("BOOM!")
github noxdafox / pebble / tests / test_thread_task.py View on Github external
    @thread.task
    def clsmethod(cls):
        return cls.a
github noxdafox / pebble / tests / test_thread_task.py View on Github external
@thread.task
def long_decorated():
    time.sleep(1)
github noxdafox / pebble / tests / test_thread_task.py View on Github external
@thread.task(callback=callback)
def decorated_callback(argument, keyword_argument=0):
    """A docstring."""
    return argument + keyword_argument
github noxdafox / pebble / tests / test_thread_task.py View on Github external
@thread.task(callback=callback)
def error_decorated_callback():
    raise Exception("BOOM!")