https://github.com/breadbored/rearfloor
Background your functions in just 10 characters
https://github.com/breadbored/rearfloor
Last synced: 29 days ago
JSON representation
Background your functions in just 10 characters
- Host: GitHub
- URL: https://github.com/breadbored/rearfloor
- Owner: breadbored
- License: mit
- Created: 2022-03-18T05:02:26.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-03-18T05:33:31.000Z (over 4 years ago)
- Last Synced: 2025-09-20T18:27:56.524Z (9 months ago)
- Language: Python
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://pip.pypa.io/en/stable/) to install RearFloor.
```bash
pip install rearfloor
```
## Usage
```python
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
[MIT](https://choosealicense.com/licenses/mit/)