Commit Graph

562 Commits

Author SHA1 Message Date
github-actions[bot] edc187e560 [skip ci] Release new versions 2024-10-16 11:35:16 +00:00
Vasek Mlejnsky 33992a6c31 Update README.md 2024-10-16 04:23:38 -07:00
Vasek Mlejnsky f502f52fff Update README.md 2024-10-16 04:11:12 -07:00
github-actions[bot] 21b1374a6e [skip ci] Release new versions 2024-10-16 10:45:54 +00:00
Jakub Novak 98336e92c1 Install dependencies required for API ref generation 2024-10-16 03:41:54 -07:00
Jakub Novak 1ee0f01b09 [skip CI] Release new versions 2024-10-16 03:25:08 -07:00
Vasek Mlejnsky 2be5fb296d Update README.md 2024-10-16 02:44:59 -07:00
Tomas Valenta 193b727dc9 Update example in docstrings 2024-10-16 02:21:03 -07:00
Jakub Novak 370b2b3fce Simplify example 2024-10-16 01:41:40 -07:00
Tomas Valenta c688b267b4 Update sync Python docstrings 2024-10-16 01:31:03 -07:00
Tomas Valenta 95baca5d1b Update async Python docstrings 2024-10-16 00:52:13 -07:00
Tereza Tizkova c682d94bc8 Update readmes 2024-10-15 16:40:07 -07:00
Jakub Novak c003af795f Revert python version 2024-10-15 14:53:07 -07:00
Jakub Novak 707b518872 Setup release pipeline to generate api ref 2024-10-15 10:17:45 -07:00
github-actions[bot] ece6346bf7 [skip ci] Release new versions 2024-10-15 15:12:26 +00:00
Jakub Novak 0c8674abc5 Update min supported version of python to 3.9 2024-10-15 08:06:43 -07:00
github-actions[bot] 47a559b729 [skip ci] Release new versions 2024-10-15 14:40:37 +00:00
Jakub Novak 38db22d573 Fix issue with poetry 2024-10-15 07:30:24 -07:00
Jakub Novak 0f292860b1 Remove protobuf runtime checks 2024-10-14 21:38:14 -07:00
Jakub Novak 23ea4adfb1 Rename rpc methods for watcher 2024-10-14 19:51:05 -07:00
Tereza Tizkova a668b3978a Merge branch 'beta' of https://github.com/e2b-dev/E2B into beta 2024-10-14 14:10:20 -07:00
Tereza Tizkova b5a6f4958e Update readme 2024-10-14 14:10:13 -07:00
Jakub Novák e48574f69c Improve file watcher in Python Sync SDK (#457)
# Description

Current solution didn't work well with in sync Python. If you're unsure
whether a file has been created, you might end up waiting for a timeout
to exit the loop.

New implementation uses polling, you can ask for events whenever you
want and it will request envd to send all events (or only new ones).
This should make it much better for users with sync Python SDK

Example of a problematic usage before and after:
## Before
```python
sbx = Sandbox()
watcher = sbx.files.watch("/home/user")
sbx.files.make_dir("test")
for event in watcher:
    print(event)
     # !!! if you don't exit, you would be stuck for the rest of the timeout (default 60 seconds)
    break
watcher.close()
```
## After
```python
sbx = Sandbox()
watcher = sbx.files.watch("/home/user")
sbx.files.make_dir("test")
events = watcher.get_new_events()
watcher.stop()
for event in events:
    print(event)
```

Even worse case was if you don't know if anything will happen:
## Before
```python
sbx = Sandbox()
watcher = sbx.files.watch("/home/user")
if random.random() > 0.5:
    sbx.files.make_dir("test")
# There's 50% chance you will get stuck. The only workaround is to run in in separate thread and you kill it after a while (you aren't really sure when it's safe)
for event in watcher:
    print(event)
    #  !!! if you don't exit, you would be stuck for the rest of the timeout (default 60 seconds)
    break
watcher.close()
```
## After
```python
sbx = Sandbox()
watcher = sbx.files.watch("/home/user")
if random.random() > 0.5:
    sbx.files.make_dir("test")
events = watcher.get_new_events()
watcher.stop()
for event in events:
    print(event)
```
2024-10-14 23:09:53 +02:00
Jakub Novak bfc4bb51d8 Rename watch to watch dir 2024-10-14 14:01:34 -07:00
Jakub Novak 6e926ecb13 Remove timeout from sync watch dir 2024-10-14 13:40:08 -07:00
Jakub Novak bc42ba1e66 Refactor watch dir 2024-10-14 13:01:59 -07:00
Jakub Novak 5c31902cc4 Change close to stop for watch dir 2024-10-14 12:10:17 -07:00
Jakub Novak 5de5385533 Update the python sdk to match the new spec 2024-10-14 12:10:04 -07:00
Jakub Novak f9978611f3 Regenerate rpc client 2024-10-14 11:30:02 -07:00
Tereza Tizkova 315c264ecd Update SDK readme 2024-10-12 20:49:33 -07:00
Jakub Novak 81db2b1466 Add sync watch handler 2024-10-11 11:54:00 +02:00
0div 87e314ada5 Merge branch 'beta' of https://github.com/e2b-dev/E2B into generate-api-refs-workflow 2024-10-10 09:22:23 +02:00
Jakub Novak 5d027aa899 Improve the process exception message 2024-10-09 17:12:43 +02:00
Jakub Novak 7356efc2bb Fix write operation description 2024-10-09 16:35:30 +02:00
0div 6a2203daf3 merge beta 2024-10-08 19:39:21 +02:00
Jakub Novak f2bec0544f Fix empty file + add tests 2024-10-08 15:28:24 +02:00
Jakub Novak 506f70c7b8 Add docstrings to SDKs 2024-10-08 13:04:39 +02:00
0div e3c6d0dc51 remove "Objects" in h2 of python-sdk api ref markdown 2024-09-27 17:40:25 +02:00
0div 7e8a2dd515 remove "Objects" in h2 of python-sdk api ref markdown 2024-09-27 17:32:30 +02:00
0div 1d9db6489e merge beta 2024-09-26 15:22:32 +02:00
Jakub Novak fe78c0320d Simplify tests 2024-09-26 13:45:24 +02:00
github-actions[bot] 8efd4d2795 [skip ci] Release new versions 2024-09-26 06:48:22 +00:00
Tomas Valenta ff368d1ba7 Explicitly configure keepalive pinging in Python SDK 2024-09-25 18:08:22 -07:00
Tomas Valenta 24e06c5e1a Fix entry info return type 2024-09-25 17:46:28 -07:00
Tomas Valenta e5b81e274c Cleanup python pty types 2024-09-25 17:42:40 -07:00
Tomas Valenta 3bd7426780 Fix possible type inconsistency 2024-09-25 17:17:27 -07:00
Tomas Valenta 10fac56058 Remove unused imports 2024-09-25 17:17:08 -07:00
Tomas Valenta daa0efb8e4 Increase python connections limit 2024-09-25 17:04:12 -07:00
Tomas Valenta 48d01df794 Use json transport for rpc in SDKs 2024-09-25 17:03:58 -07:00
0div fa90994e49 [squashed many commits] GH actions workflow for API ref autogen 2024-09-24 18:15:31 +02:00