Observable.timer unexpected/undocumented for large timeouts
See original GitHub issueRxJS version: 5.5.2
Code to reproduce:
Rx.Observable
.timer(new Date(2017, 10, 28))
.subscribe(() => {
console.log('Immediate emit');
});
Expected behavior: Should emit about a month from today (Oct 27, 2017).
Actual behavior: Emits immediately.
Additional information: I gather the timers has a max value of 2147483647 (2^31-1), and it makes sense to have such a limitation, but I would suggest an argument check and/or a warning or note in the documentation. An error seems justified as I cannot imagine someone passing in a value greater than that an expecting a 1 ms timeout.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:11
- Comments:10 (2 by maintainers)
Top Results From Across the Web
Observable Timer for screen timeout android - rx java
Sets Timeout. It throws TimeoutException , when there is no emitted item for specified amount of time ( TIMEOUT_INTERVAL ). Timer is started ......
Read more >BIG-IP 13.1.1.5 Fixes and Known Issues - AskF5 - F5 Networks
Since non-violating traffic is not sent to the policy engine, the inactivity timeout timer is never reset, which will eventually lead to suggestions...
Read more >Consolidated JDK 8 Release Notes - Oracle
Consolidated Release Notes for JDK 8 and JDK 8 Update Releases. BPR builds are available only as commercial offerings to Oracle customers.
Read more >The Ultimate Guide to Android Bluetooth Low Energy
Unfortunately, the Android SDK's BLE API is full of undocumented ... has a high enough advertising interval that it doesn't overlap with the ......
Read more >Bug listing with status RESOLVED with resolution OBSOLETE ...
_rc78 with USE=ipc: ebuild-ipc timed out if bashrcng shmfs-plugin is enabled. ... Bug:395681 - "kernel: kvm: pit timer with no irqchip crashes the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Here is a workaround for large timeouts:
timer().pipe(delay(timeout))
We could test to see if it’s more than 2147483647, and if so, schedule an interval… basically something like this:
I mean we could make it work… I’d probably do something more efficient than whats up there. A
setInterval
with a counter or something. Or add support directly to theAsapScheduler
.However it seems like it would be really weird for someone to want to do this, and they could just as easily do what I did above.