Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Programmation Python
Les fondamentaux
Voir le programme détaillé
Classe « Flask »

Méthode flask.Flask.async_to_sync

Signature de la méthode async_to_sync

def async_to_sync(self, func: 't.Callable[..., t.Coroutine[t.Any, t.Any, t.Any]]') -> 't.Callable[..., t.Any]' 

Description

help(Flask.async_to_sync)

Return a sync function that will run the coroutine function.

.. code-block:: python

    result = app.async_to_sync(func)(*args, **kwargs)

Override this method to change how the app converts async code
to be synchronously callable.

.. versionadded:: 2.0


Vous êtes un professionnel et vous avez besoin d'une formation ? Programmation Python
Les fondamentaux
Voir le programme détaillé