Skip to content

Commit b7b9edf

Browse files
demenskybenlesh
authored andcommitted
feat(scheduler): removed deprecated queueScheduler constant
BREAKING CHANGE: The `queue` constant is no longer available. Use `queueScheduler`.
1 parent edac583 commit b7b9edf

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

docs_app/content/guide/scheduler.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ The `async` Scheduler is one of the built-in schedulers provided by RxJS. Each o
116116

117117
## Using Schedulers
118118

119-
You may have already used schedulers in your RxJS code without explicitly stating the type of schedulers to be used. This is because all Observable operators that deal with concurrency have optional schedulers. If you do not provide the scheduler, RxJS will pick a default scheduler by using the principle of least concurrency. This means that the scheduler which introduces the least amount of concurrency that satisfies the needs of the operator is chosen. For example, for operators returning an observable with a finite and small number of messages, RxJS uses no Scheduler, i.e. `null` or `undefined`. For operators returning a potentially large or infinite number of messages, `queue` Scheduler is used. For operators which use timers, `async` is used.
119+
You may have already used schedulers in your RxJS code without explicitly stating the type of schedulers to be used. This is because all Observable operators that deal with concurrency have optional schedulers. If you do not provide the scheduler, RxJS will pick a default scheduler by using the principle of least concurrency. This means that the scheduler which introduces the least amount of concurrency that satisfies the needs of the operator is chosen. For example, for operators returning an observable with a finite and small number of messages, RxJS uses no Scheduler, i.e. `null` or `undefined`. For operators returning a potentially large or infinite number of messages, `queueScheduler` Scheduler is used. For operators which use timers, `async` is used.
120120

121121
Because RxJS uses the least concurrency scheduler, you can pick a different scheduler if you want to introduce concurrency for performance purpose. To specify a particular scheduler, you can use those operator methods that take a scheduler, e.g., `from([10, 20, 30], asyncScheduler)`.
122122

@@ -146,4 +146,4 @@ Time-related operators like `bufferTime`, `debounceTime`, `delay`, `auditTime`,
146146

147147
Other instance operators that take a Scheduler as argument: `cache`, `combineLatest`, `concat`, `expand`, `merge`, `publishReplay`, `startWith`.
148148

149-
Notice that both `cache` and `publishReplay` accept a Scheduler because they utilize a ReplaySubject. The constructor of a ReplaySubjects takes an optional Scheduler as the last argument because ReplaySubject may deal with time, which only makes sense in the context of a Scheduler. By default, a ReplaySubject uses the `queue` Scheduler to provide a clock.
149+
Notice that both `cache` and `publishReplay` accept a Scheduler because they utilize a ReplaySubject. The constructor of a ReplaySubjects takes an optional Scheduler as the last argument because ReplaySubject may deal with time, which only makes sense in the context of a Scheduler. By default, a ReplaySubject uses the `queueScheduler` Scheduler to provide a clock.

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export { AsyncSubject } from './internal/AsyncSubject';
2929
/* Schedulers */
3030
export { asapScheduler } from './internal/scheduler/asap';
3131
export { async, asyncScheduler } from './internal/scheduler/async';
32-
export { queue, queueScheduler } from './internal/scheduler/queue';
32+
export { queueScheduler } from './internal/scheduler/queue';
3333
export { animationFrameScheduler } from './internal/scheduler/animationFrame';
3434
export { VirtualTimeScheduler, VirtualAction } from './internal/scheduler/VirtualTimeScheduler';
3535
export { Scheduler } from './internal/Scheduler';

src/internal/scheduler/queue.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ import { QueueScheduler } from './QueueScheduler';
77
*
88
* <span class="informal">Put every next task on a queue, instead of executing it immediately</span>
99
*
10-
* `queue` scheduler, when used with delay, behaves the same as {@link asyncScheduler} scheduler.
10+
* `queueScheduler` scheduler, when used with delay, behaves the same as {@link asyncScheduler} scheduler.
1111
*
1212
* When used without delay, it schedules given task synchronously - executes it right when
1313
* it is scheduled. However when called recursively, that is when inside the scheduled task,
1414
* another task is scheduled with queue scheduler, instead of executing immediately as well,
1515
* that task will be put on a queue and wait for current one to finish.
1616
*
17-
* This means that when you execute task with `queue` scheduler, you are sure it will end
17+
* This means that when you execute task with `queueScheduler` scheduler, you are sure it will end
1818
* before any other task scheduled with that scheduler will start.
1919
*
2020
* ## Examples
@@ -65,8 +65,3 @@ import { QueueScheduler } from './QueueScheduler';
6565
*/
6666

6767
export const queueScheduler = new QueueScheduler(QueueAction);
68-
69-
/**
70-
* @deprecated Renamed to {@link queueScheduler}. Will be removed in v8.
71-
*/
72-
export const queue = queueScheduler;

0 commit comments

Comments
 (0)