Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async AWS Lambda Integration for Media Rendering with Python #4610

Open
steinathan opened this issue Dec 8, 2024 · 1 comment
Open

Async AWS Lambda Integration for Media Rendering with Python #4610

steinathan opened this issue Dec 8, 2024 · 1 comment

Comments

@steinathan
Copy link

Feature Request 🛍️

The current Python Lambda package for remotion_lambda python appears to be blocking and lacks native support for asynchronous execution. This limits its integration with async-driven environments and frameworks, which are increasingly common in modern Python applications. Adding support for async Lambda functions would enhance its usability and improve compatibility with contemporary architectures.

Use Case

  • Support for non-blocking, asynchronous execution in the Python Lambda package.
  • Enable better compatibility with async workflows, such as asyncio or frameworks relying on asynchronous I/O.

Possible Solution

  • Modify the Lambda function execution model to allow for async functions and non-blocking behavior.
  • Consider adding configuration options for handling async functions or integrating with asyncio-based workflows.
  • Ensure backward compatibility with existing blocking functions for users not using async operations. (AsyncRemotionClient and RemotionClient)

I am happy to make contributions if the proposed solution is acceptable. Let me know if further discussion or implementation is needed!

@JonnyBurger
Copy link
Member

Thanks for this suggestion!

That makes a lot of sense for sure.
I think we can do this by using InvocationType = 'Event' in here:

response = client.invoke(
FunctionName=function_name, Payload=payload, )
result = response['Payload'].read().decode('utf-8')

(referring to the docs, very bottom of the page: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/lambda/client/invoke.html#)

Thanks for offering to make a contribution, I'd be very happy if you'd try that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants