Commit Graph

581 Commits

Author SHA1 Message Date
Jakub Novak d051dfd699 Fix permissions and fix missing files from release 2024-10-22 13:59:47 -07:00
Jakub Novak 6bd8212f42 Handle rate limit errors in JS SDK 2024-10-22 11:35:28 -07:00
Tomas Valenta aa302edc96 Change exception descriptions; Add TODO comment 2024-10-21 10:35:54 -07:00
Jakub Novak d5be96d4c4 Increase test timeouts 2024-10-17 21:03:23 -07:00
Jakub Novak 9d5cf98cd7 Fix timeout in browser test 2024-10-17 20:51:54 -07:00
github-actions[bot] edc187e560 [skip ci] Release new versions 2024-10-16 11:35:16 +00:00
Vasek Mlejnsky 5a33b46a57 Update README.md 2024-10-16 04:23:21 -07:00
Vasek Mlejnsky d3606ef368 Update README.md 2024-10-16 04:11:37 -07:00
Vasek Mlejnsky 9981f98eb9 Update README.md 2024-10-16 04:09:58 -07:00
Jakub Novak 1ee0f01b09 [skip CI] Release new versions 2024-10-16 03:25:08 -07:00
Jakub Novak e037a945a2 Increase browser timeout 2024-10-16 03:07:49 -07:00
Vasek Mlejnsky af7fb9f806 Update README.md 2024-10-16 02:44:24 -07:00
Vasek Mlejnsky 51456b05c9 Update README.md 2024-10-16 02:40:27 -07:00
Tomas Valenta 95baca5d1b Update async Python docstrings 2024-10-16 00:52:13 -07:00
Tomas Valenta ce68e3451c Update JS SDK docstrings 2024-10-15 23:10:19 -07:00
Tomas Valenta 16dab9296b Fix default values formatting 2024-10-15 17:13:48 -07:00
Tomas Valenta a60239eb39 Merge branch 'beta' of https://github.com/e2b-dev/E2B into beta 2024-10-15 17:00:32 -07:00
Tomas Valenta 7a3dd7c632 Update JS SDK docstrings 2024-10-15 17:00:22 -07:00
Tereza Tizkova c682d94bc8 Update readmes 2024-10-15 16:40:07 -07:00
Jakub Novak 707b518872 Setup release pipeline to generate api ref 2024-10-15 10:17:45 -07:00
Jakub Novak d8c609d208 Revert pnpm lock 2024-10-15 08:26:25 -07:00
github-actions[bot] ece6346bf7 [skip ci] Release new versions 2024-10-15 15:12:26 +00:00
github-actions[bot] 47a559b729 [skip ci] Release new versions 2024-10-15 14:40:37 +00:00
Jakub Novak 9ef205c2eb Merge pipelines 2024-10-15 07:24:51 -07:00
Jakub Novak e500af6eb3 Bump version 2024-10-15 07:03:58 -07:00
Jakub Novak bcea20f7bc Start tests with python 2024-10-14 23:11:51 -07:00
Jakub Novak 3844442bf1 Bump version 2024-10-14 23:05:33 -07:00
Jakub Novak c8b5d029f2 Fix browser test 2024-10-14 22:53:20 -07:00
Jakub Novak 23ea4adfb1 Rename rpc methods for watcher 2024-10-14 19:51:05 -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 5c31902cc4 Change close to stop for watch dir 2024-10-14 12:10:17 -07:00
Tereza Tizkova 315c264ecd Update SDK readme 2024-10-12 20:49:33 -07:00
Vasek Mlejnsky a8b1ee9181 Add typedoc to dev dependencies of the JS SDK 2024-10-12 12:56:19 -07:00
Tomas Valenta e5448c9abc Add dir with testing artifacts to gitignore 2024-10-11 15:32:39 -07: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 7356efc2bb Fix write operation description 2024-10-09 16:35:30 +02:00
Jakub Novak fbc14b342f Add browser test 2024-10-09 16:26:15 +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 1d9db6489e merge beta 2024-09-26 15:22:32 +02:00
Jakub Novak fe78c0320d Simplify tests 2024-09-26 13:45:24 +02:00
Jakub Novak b334c0e261 Add pty tests in js 2024-09-26 12:36:55 +02:00
github-actions[bot] 8efd4d2795 [skip ci] Release new versions 2024-09-26 06:48:22 +00:00
Tomas Valenta 41853ccf98 Add keepalive ping and error handlers to pty 2024-09-25 17:32:04 -07:00
Tomas Valenta 81d349cb0b Create constant for keepalive header 2024-09-25 17:31:43 -07:00
Tomas Valenta 1c6c44c782 Fix possible type inconsistency 2024-09-25 17:16:04 -07:00
Tomas Valenta 71406236c0 Explicitly configure keepalive pinging 2024-09-25 17:06:59 -07:00
Tomas Valenta 48d01df794 Use json transport for rpc in SDKs 2024-09-25 17:03:58 -07:00