E2B icon indicating copy to clipboard operation
E2B copied to clipboard

Python Async sandbox

Open PrathamSoni opened this issue 6 months ago • 6 comments

Is your feature request related to a problem? Please describe. Deploying as part of a webserver so would like async functionality of sandbox

Describe the solution you'd like async methods for sandbox usage

Describe alternatives you've considered Considered using modal

Might be missing something here on usage so happy for any pointers.

PrathamSoni avatar Feb 07 '24 02:02 PrathamSoni

Hey @PrathamSoni, we currently don't have async version but it's usually possible to wrap our SDK in async code.

  1. What kind of Python webserver framework are you using?
  2. What made you use E2B instead of Modal?

mlejva avatar Feb 07 '24 03:02 mlejva

using a fastapi server. would prefer to have async native code but sure yes i can manually wrap things. Was just facing some bugs with their sandbox; however, I will say there documentation is somewhat nicer.

PrathamSoni avatar Feb 07 '24 14:02 PrathamSoni

Also, quick follow up, are the sandboxes designed to handle multiple incoming requests? For example, if I want to read multiple files concurrently, would it be able to do that or would each file read be synchronous on the server-side

PrathamSoni avatar Feb 07 '24 14:02 PrathamSoni

Hi @PrathamSoni,

Also, quick follow up, are the sandboxes designed to handle multiple incoming requests? For example, if I want to read multiple files concurrently, would it be able to do that or would each file read be synchronous on the server-side

Yes, when using download_file you should be able to be download multiple files concurrently.

however, I will say there documentation is somewhat nicer.

Please bear with us, we're a new company and a small team — things will get better. DX and docs is our main focus right now. Can I ask what about the Modal documentation did you like better?

ValentaTomas avatar Feb 07 '24 17:02 ValentaTomas

Hey @PrathamSoni, were you able to make it work without using async?

ValentaTomas avatar Feb 14 '24 01:02 ValentaTomas

hey working with simple run in threadpool concurrency but would appreciate native solution

PrathamSoni avatar Feb 19 '24 00:02 PrathamSoni