This package uses threading to create a simple future-like async interface for functions.
Project description
Asynct
Table of Contents
Overview
This package uses threading to create a simple future-like async interface for functions.
Usage
To make a function async you can use the make_asynct decorator:
@make_asynct # Now this function won't block the main thread when ran.
def func(): ...
You can then use the result of the function (which is an asynct object) - either asynchronously or synchronously:
func_asynct = func()
@func_asynct.then
def does_something_with_the_result(result): ...
@does_something_with_the_result.then
def does_another_thing_with_the_result(result): ...
# or
result = func_asynct.await_it()
# ...
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file asynct-0.0.2.tar.gz.
File metadata
- Download URL: asynct-0.0.2.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f6c8fe56b42e86882b2993f5e6bd61f8ea754f09d0f0474dbc76a31ab37db58
|
|
| MD5 |
0bb767837c0653d8fbdec83cdcc8119a
|
|
| BLAKE2b-256 |
645a135eaaf9e0d821a4f0820ca58a714394d4a7276d4ebad8bc7dddf5672f07
|
File details
Details for the file asynct-0.0.2-py3-none-any.whl.
File metadata
- Download URL: asynct-0.0.2-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
551b814a22ed858f11840e6fe7ca55e57f94e1d28e84c6845c6f9fb83e188e1b
|
|
| MD5 |
6a25efeb87f851b1d29e579ac6adbc5e
|
|
| BLAKE2b-256 |
d075f958bb5cf83a4da2b225f42a71bf61a5016f807a47b310fb78f2c704f103
|