Replies: 1 comment 1 reply
-
|
I like these ideas. Should we keep the existing timeouts to cover backwards-compatibility, and keep plain timeout & throttling cases simple? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We currently expose timeouts and debounce operations built-in to
sqlite_asyncby passing durations:onChangeandwatchhave aDuration throttleparameter indicating a minimum delay between durations.readTransactionandwriteTransactionhave aDuration lockTimeoutparameter indicating the maximum time to wait for a free connection.Having these APIs available is nice, but they don't provide all the flexibility a user might need:
Both of these cases aren't exactly common, but it doesn't cost us much to support them:
throttleparameter on streams, and rely on backpressure instead:onChange, if the subscription is paused we'd buffer into a set of updated tables and emit once the subscription is resumed.watch, we'd start fetching when the subscription is resumed and just keep a "dirty" flag we'd set when an upstream update comes in while the subscription is paused.Future<void>as a generalization. If users want timeouts, they can pass aFuture.delayed. Internally, we'd use.whenComplete()as an abort signal. This is also how abort signals are expressed in thehttppackage and it seems to work.Beta Was this translation helpful? Give feedback.
All reactions