source: trip-planner-front/node_modules/rxjs/internal/scheduler/asap.d.ts

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.6 KB
Line 
1import { AsapScheduler } from './AsapScheduler';
2/**
3 *
4 * Asap Scheduler
5 *
6 * <span class="informal">Perform task as fast as it can be performed asynchronously</span>
7 *
8 * `asap` scheduler behaves the same as {@link asyncScheduler} scheduler when you use it to delay task
9 * in time. If however you set delay to `0`, `asap` will wait for current synchronously executing
10 * code to end and then it will try to execute given task as fast as possible.
11 *
12 * `asap` scheduler will do its best to minimize time between end of currently executing code
13 * and start of scheduled task. This makes it best candidate for performing so called "deferring".
14 * Traditionally this was achieved by calling `setTimeout(deferredTask, 0)`, but that technique involves
15 * some (although minimal) unwanted delay.
16 *
17 * Note that using `asap` scheduler does not necessarily mean that your task will be first to process
18 * after currently executing code. In particular, if some task was also scheduled with `asap` before,
19 * that task will execute first. That being said, if you need to schedule task asynchronously, but
20 * as soon as possible, `asap` scheduler is your best bet.
21 *
22 * ## Example
23 * Compare async and asap scheduler<
24 * ```ts
25 * import { asapScheduler, asyncScheduler } from 'rxjs';
26 *
27 * asyncScheduler.schedule(() => console.log('async')); // scheduling 'async' first...
28 * asapScheduler.schedule(() => console.log('asap'));
29 *
30 * // Logs:
31 * // "asap"
32 * // "async"
33 * // ... but 'asap' goes first!
34 * ```
35 */
36export declare const asapScheduler: AsapScheduler;
37/**
38 * @deprecated renamed. Use {@link asapScheduler}
39 */
40export declare const asap: AsapScheduler;
Note: See TracBrowser for help on using the repository browser.