A sidekick to make your AWS Lambda async
Project description
lambchop
A sidekick that makes your AWS Lambda async
Overview
lambchop
is an Python package that gives regular AWS Lambda asyncronous functionality by allow them to run background processes. This works by utilizing AWS Lambda extensions which runs in a different process than the main lambda function code.
Installation
pypi:
pip install lambchop
github:
pip install git+ssh://git@github.com/dave-lanigan/lambchop.git
pip install git+https://git@github.com/dave-lanigan/lambchop.git
📝 Sudo privileges may be required because the lambda extension resides in the
/opt/extensions/
directory
Usage
import time
from lambchop import SideKick
def long_running_process(x, y):
print("Starting process 1.")
time.sleep(x + y)
print("Completed.")
def long_running_process2(x, y):
print("Starting process 2.")
time.sleep(x + y)
print("Completed.")
def main():
sk = SideKick()
sk.add_task(long_running_process, x=5, y=3)
sk.add_task(long_running_process2, x=5, y=3)
sk.process()
if __name__ == "__main__":
main()
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
lambchop-0.0.13.tar.gz
(5.8 kB
view details)
File details
Details for the file lambchop-0.0.13.tar.gz
.
File metadata
- Download URL: lambchop-0.0.13.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f891e860cfd71ac14ab92d16cbf7b593ca79face52af91629426fff409bbbf3 |
|
MD5 | 4266393c2af4bd11de66585bdc16ce3b |
|
BLAKE2b-256 | e1678ea1b6e83741216289c4f8a36c7630ef9977f57a4ea315c8f6af9b24a5e9 |