Concurrency Utils¶
fastpubsub.concurrency.utils.apply_async
async
¶
Transforms a blocking sync callable into a async callable.
| PARAMETER | DESCRIPTION |
|---|---|
func
|
The sync callable to be transformed.
TYPE:
|
*args
|
The positional arguments used on the callable.
TYPE:
|
**kwargs
|
The keyword arguments used on the callable.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
T
|
The same return of the callable but after awaiting for |
T
|
its computation. |
Source code in fastpubsub/concurrency/utils.py
fastpubsub.concurrency.utils.ensure_async_middleware
¶
Ensures that a middleware is an async middleware.
| PARAMETER | DESCRIPTION |
|---|---|
middleware
|
The middleware to check.
TYPE:
|
Source code in fastpubsub/concurrency/utils.py
fastpubsub.concurrency.utils.ensure_async_callable_function
¶
Ensures that a callable is an async function.
| PARAMETER | DESCRIPTION |
|---|---|
callable_object
|
The callable to check.
TYPE:
|