Server IP : 185.86.78.101 / Your IP : 216.73.216.124 Web Server : Apache System : Linux 675867-vds-valikoshka1996.gmhost.pp.ua 5.4.0-150-generic #167-Ubuntu SMP Mon May 15 17:35:05 UTC 2023 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /www/wwwroot/mifepriston.org/node_modules/rxjs/operators/ |
Upload File : |
import { IScheduler } from '../Scheduler'; import { MonoTypeOperatorFunction } from '../interfaces'; /** * * Errors if Observable does not emit a value in given time span. * * <span class="informal">Timeouts on Observable that doesn't emit values fast enough.</span> * * <img src="./img/timeout.png" width="100%"> * * `timeout` operator accepts as an argument either a number or a Date. * * If number was provided, it returns an Observable that behaves like a source * Observable, unless there is a period of time where there is no value emitted. * So if you provide `100` as argument and first value comes after 50ms from * the moment of subscription, this value will be simply re-emitted by the resulting * Observable. If however after that 100ms passes without a second value being emitted, * stream will end with an error and source Observable will be unsubscribed. * These checks are performed throughout whole lifecycle of Observable - from the moment * it was subscribed to, until it completes or errors itself. Thus every value must be * emitted within specified period since previous value. * * If provided argument was Date, returned Observable behaves differently. It throws * if Observable did not complete before provided Date. This means that periods between * emission of particular values do not matter in this case. If Observable did not complete * before provided Date, source Observable will be unsubscribed. Other than that, resulting * stream behaves just as source Observable. * * `timeout` accepts also a Scheduler as a second parameter. It is used to schedule moment (or moments) * when returned Observable will check if source stream emitted value or completed. * * @example <caption>Check if ticks are emitted within certain timespan</caption> * const seconds = Rx.Observable.interval(1000); * * seconds.timeout(1100) // Let's use bigger timespan to be safe, * // since `interval` might fire a bit later then scheduled. * .subscribe( * value => console.log(value), // Will emit numbers just as regular `interval` would. * err => console.log(err) // Will never be called. * ); * * seconds.timeout(900).subscribe( * value => console.log(value), // Will never be called. * err => console.log(err) // Will emit error before even first value is emitted, * // since it did not arrive within 900ms period. * ); * * @example <caption>Use Date to check if Observable completed</caption> * const seconds = Rx.Observable.interval(1000); * * seconds.timeout(new Date("December 17, 2020 03:24:00")) * .subscribe( * value => console.log(value), // Will emit values as regular `interval` would * // until December 17, 2020 at 03:24:00. * err => console.log(err) // On December 17, 2020 at 03:24:00 it will emit an error, * // since Observable did not complete by then. * ); * * @see {@link timeoutWith} * * @param {number|Date} due Number specifying period within which Observable must emit values * or Date specifying before when Observable should complete * @param {Scheduler} [scheduler] Scheduler controlling when timeout checks occur. * @return {Observable<T>} Observable that mirrors behaviour of source, unless timeout checks fail. * @method timeout * @owner Observable */ export declare function timeout<T>(due: number | Date, scheduler?: IScheduler): MonoTypeOperatorFunction<T>;