-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat: add remote function query.stream
#14292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: query-batch
Are you sure you want to change the base?
Conversation
- streams are deduplicated on the client, i.e. same resource+payload == same stream instance - a stream is kept open as long as it's either in a reactive context or someone iterates over it. Streams can close when noone listens anymore and open back up when someone does again - cannot iterate on the server right now, only retrieve the first value via promise - cannot refresh/override (doesn't make sense)
🦋 Changeset detectedLatest commit: a649cf0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
How confident are we about the deduplication part? For cases where you're streaming a live view of some database query, that makes sense, but are there cases more like this? for await (const n of countToTen()) {
console.log(n);
} It would be weird if I did that and it started at 7 because of something happening in an unrelated component. Genuinely not sure what the right way to think about this is. |
yeah I had the same thought already. Hard to tell, both ways make sense - which maybe means we need to give people some way to tell what it is? Update: maybe it should be "each invocation is a separate stream". Then you can still deduplicate yourself if you want to. |
WIP, builds on top of the query-batch PR to avoid merge conflicts like crazy since they touch the same files; the batch PR should be merged first
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. Changesets that add features should beminor
and those that fix bugs should bepatch
. Please prefix changeset messages withfeat:
,fix:
, orchore:
.