jh0ker · GitHub

Merged

Merged

Conversation

Eldinnie

telegram.utils.promise Module
=============================

.. automodule:: telegram.utils.promise
telegram.utils.request Module
=============================

.. automodule:: telegram.utils.request
"""A simple Promise implementation for use with the run_async decorator, DelayQueue etc.

Args:
pooled_function (callable): The callable that will be called concurrently.

Args:
pooled_function (callable): The callable that will be called concurrently.
args (list|tuple): Positional arguments for ``pooled_function``
Args:
pooled_function (callable): The callable that will be called concurrently.
args (list|tuple): Positional arguments for ``pooled_function``
kwargs (dict): Keyword arguments for ``pooled_function``

Attributes:
pooled_function (callable): The callable that will be called concurrently.
args (list|tuple): Positional arguments for ``pooled_function``
self._exception = None

def run(self):
"""Calls the ``pooled_function`` callable."""
calculated. ``None`` means indefinite. Default is ``None``.

Returns:
Returns the return value of ``pooled_function`` or ``None`` if the ``timeout`` expires.
Returns the return value of ``pooled_function`` or ``None`` if the ``timeout`` expires.

Raises:
Any exception raised by ``pooled_function``.

@property
def exception(self):
"""The exception raised by ``pooled_function`` or ``None`` if no exception has been raised
[CI skip]

Eldinnie

@Eldinnie

@Eldinnie

Read the original on github.com ↗