# 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)
```
# Description
- For now, any diff in `packages/` makes the workflow run each package's
`./scripts/generate_api_ref.sh`
- Each of these scripts now also copies and creates the proper file
structure, including versions, in
`apps/web/src/app/(docs)/docs/api-reference/`
- Boyscouting & Testing: Include Pty api ref to python sdk workflow &
test if it triggers the workflow
- Once the workflow generates the files, it auto-commits before the
deploy
- Created and integrated a prebuild step for the nextjs app it:
- generates routes for `routes.tsx`
- and generates TOC markowns for api-ref navigation component
# Test
- [x] Going to test it via this PR
- [x] Deploy [e2b-web](https://e2b-ijic9mwke-e2b.vercel.app/docs)
# Considerations
Could make this on a per package basis.