Commit Graph

4236 Commits

Author SHA1 Message Date
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
Vasek Mlejnsky c4dce0c849 Update docs 2024-10-14 13:33:11 -07:00
Vasek Mlejnsky d220d4da7a Update docs 2024-10-14 13:31:31 -07:00
Jakub Novak bc42ba1e66 Refactor watch dir 2024-10-14 13:01:59 -07:00
Vasek Mlejnsky 22044ba13c Update text size 2024-10-14 12:22:42 -07:00
Vasek Mlejnsky 7fc0a0f81b Add quickstart page about installing custom packages 2024-10-14 12:15:20 -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
Vasek Mlejnsky 024d30ed45 Fix docs build 2024-10-14 11:35:58 -07:00
Jakub Novak f9978611f3 Regenerate rpc client 2024-10-14 11:30:02 -07:00
Jakub Novak c5aa13ea86 Fix command for generating from rpc spec 2024-10-14 11:29:20 -07:00
Vasek Mlejnsky 23c4d75494 remove unused prop 2024-10-14 11:19:30 -07:00
Vasek Mlejnsky 03d427bdd2 Disable search 2024-10-14 11:11:32 -07:00
Vasek Mlejnsky e2ef68b6dd Update code snippets 2024-10-14 11:10:53 -07:00
Vasek Mlejnsky 375bddb7d4 Remove import 2024-10-14 09:53:01 -07:00
Vasek Mlejnsky 33eea6adcc Resolve merge conflicts 2024-10-14 09:50:56 -07:00
Vasek Mlejnsky 7159c01bcf Add guides 2024-10-14 09:48:52 -07:00
0div 81c598cff9 update pnpm lock 2024-10-14 10:11:51 +02:00
0div 26022c1c1e fix relative paths in README 2024-10-14 10:08:36 +02:00
0div 6e8edaf60a fix relative paths in README 2024-10-14 10:07:47 +02:00
0div 18b742a843 Merge branch 'beta' of https://github.com/e2b-dev/E2B into beta 2024-10-14 10:01:20 +02:00
0div 6f904804cf update webapp README to explain the auto-generated api ref sdk workflow 2024-10-14 10:00:22 +02:00
Vasek Mlejnsky 085a6cbf4f Automatically expand navigation subgroups based on URL 2024-10-13 20:36:33 -07:00
Vasek Mlejnsky 6a5505738a Update navigation; create first quickstart page 2024-10-13 20:04:47 -07:00
Vasek Mlejnsky 12f7723078 Update navigation 2024-10-13 10:43:55 -07:00
Vasek Mlejnsky c026d3b40d Merge branch 'beta' of https://github.com/e2b-dev/E2B into beta 2024-10-13 10:41:14 -07:00
Vasek Mlejnsky 895c5f360f Update navigation sidebar 2024-10-13 10:41:08 -07:00
Tereza Tizkova 315c264ecd Update SDK readme 2024-10-12 20:49:33 -07:00
Tereza Tizkova 1b8957118f Update E2B CLI readme 2024-10-12 20:42:04 -07:00
Tereza Tizkova d9c5cf00ad Merge branch 'beta' of https://github.com/e2b-dev/E2B into beta 2024-10-12 20:10:13 -07:00
Tereza Tizkova 882ea85462 Update readme 2024-10-12 20:10:04 -07:00
Vasek Mlejnsky b26b93b1c7 Cleanup commented code 2024-10-12 17:05:34 -07:00
Vasek Mlejnsky 42b7891610 Cleanup commented out code 2024-10-12 17:04:30 -07:00
Vasek Mlejnsky c2e670c5d5 Redesign sidebar (desktop) 2024-10-12 17:03:12 -07:00
Tomas Valenta a0bcaa5646 Update CLI template build example snippet 2024-10-12 15:43:58 -07:00
Tomas Valenta a1bb36f729 Merge branch 'beta' of https://github.com/e2b-dev/E2B into beta 2024-10-12 13:44:25 -07:00
Tomas Valenta d2e9b3ba8a Update CLI docs 2024-10-12 13:44:23 -07:00
github-actions[bot] 7c4d44e206 [skip ci] Release new SDK API reference doc versions 2024-10-12 20:40:58 +00:00
Tomas Valenta 125cda6cc7 Add flag for killing all running sandboxes to the CLI 2024-10-12 13:39:42 -07:00
github-actions[bot] f2de8cb89f [skip ci] Release new SDK API reference doc versions 2024-10-12 19:57:33 +00:00
Vasek Mlejnsky a8b1ee9181 Add typedoc to dev dependencies of the JS SDK 2024-10-12 12:56:19 -07:00
Vasek Mlejnsky f049bb1fef Update gitignore 2024-10-12 12:22:44 -07:00
Vasek Mlejnsky 047039cf47 Resolve merge conflicts 2024-10-12 11:42:19 -07:00
Vasek Mlejnsky b7cafcd380 pnpm-lock 2024-10-12 11:31:07 -07:00
Vasek Mlejnsky 9e0721cc85 Prepare new docs navigation [WIP] 2024-10-12 11:30:51 -07:00
Tomas Valenta e5448c9abc Add dir with testing artifacts to gitignore 2024-10-11 15:32:39 -07:00