Easily background your functions in just 10 characters
Project description
RearFloor (Background)
RearFloor is a library to make your functions and class methods run in the background asynchronously with just 10 characters.
This is a lightweight library that takes <5 minutes to audit. Whether you're a small developer looking for a solution, or a large and soulless corporation, this library will save you seconds in both server response time and finding an answer on StackOverflow that does the same thing.
Installation
Use the package manager pip to install RearFloor.
pip install rearfloor
Usage
from rearfloor import rearfloor
# Here's a boring, synchronous function
def synchronousFunction(text_to_print: str):
print("Synchronous:", text_to_print)
# Now use that function.
# The rest of the program waits for it to stop before moving on.
synchronousFunction("Lame")
# Here's a rad, asynchronous function
@rearfloor
def asynchronousFunction(text_to_print: str):
print("Asynchronous:", text_to_print)
# Now use *that* function.
# The rest of the program moves on, reducing your wait time on tasks
# that aren't going to return or modify a value.
asynchronousFunction("Sick")
I use this to asynchronously write to the database in a high traffic, low response time Flask application. Now my customers can get a response in <90ms instead of 400-1500ms and the data is still recorded!
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
License
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
Hashes for rearfloor-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 099c74001320963fecda9570d502daf848040b6b4bcf640258323703b00fc41a |
|
MD5 | 99902d96cfaa6fce8adcef15062e0917 |
|
BLAKE2b-256 | e28a01a31fbf50ad758ab330d48c48fd59f3671178b9f87917d832805f77520b |