Closed jakubno closed 1 month ago
Latest commit: bfc4bb51d8cddcf9ecb709c5b7118ada1f47e206
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Few notes:
A few notes to both SDKs:
Instead sbx.files.watch()
maybe we should do sbx.files.watch_dir()
to signal better that it's about watching the directory?
Instead of watcher.close()
, let's do watcher.stop()
because when thinking about it - you start watcher and then you stop it.
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
After
Even worse case was if you don't know if anything will happen:
Before
After