Skip to content

Commit

Permalink
feat(AsyncScheduler): add AsyncScheduler implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
trxcllnt committed Mar 7, 2016
1 parent c4f5408 commit 4486c1f
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Rx.DOM.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,11 @@ import {EmptyError} from './util/EmptyError';
import {ArgumentOutOfRangeError} from './util/ArgumentOutOfRangeError';
import {ObjectUnsubscribedError} from './util/ObjectUnsubscribedError';
import {asap} from './scheduler/asap';
import {async} from './scheduler/async';
import {queue} from './scheduler/queue';
import {animationFrame} from './scheduler/animationFrame';
import {AsapScheduler} from './scheduler/AsapScheduler';
import {AsyncScheduler} from './scheduler/AsyncScheduler';
import {QueueScheduler} from './scheduler/QueueScheduler';
import {AnimationFrameScheduler} from './scheduler/AnimationFrameScheduler';
import {rxSubscriber} from './symbol/rxSubscriber';
Expand All @@ -136,6 +138,7 @@ import {AjaxRequest, AjaxResponse, AjaxError, AjaxTimeoutError} from './observab
/* tslint:disable:no-var-keyword */
var Scheduler = {
asap,
async,
queue,
animationFrame
};
Expand Down
3 changes: 3 additions & 0 deletions src/Rx.KitchenSink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,10 @@ import {EmptyError} from './util/EmptyError';
import {ObjectUnsubscribedError} from './util/ObjectUnsubscribedError';
import {ArgumentOutOfRangeError} from './util/ArgumentOutOfRangeError';
import {asap} from './scheduler/asap';
import {async} from './scheduler/async';
import {queue} from './scheduler/queue';
import {AsapScheduler} from './scheduler/AsapScheduler';
import {AsyncScheduler} from './scheduler/AsyncScheduler';
import {QueueScheduler} from './scheduler/QueueScheduler';
import {TimeInterval} from './operator/timeInterval';
import {TestScheduler} from './testing/TestScheduler';
Expand All @@ -184,6 +186,7 @@ import {rxSubscriber} from './symbol/rxSubscriber';
/* tslint:disable:no-var-keyword */
var Scheduler = {
asap,
async,
queue
};

Expand Down
3 changes: 3 additions & 0 deletions src/Rx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,18 @@ import {EmptyError} from './util/EmptyError';
import {ArgumentOutOfRangeError} from './util/ArgumentOutOfRangeError';
import {ObjectUnsubscribedError} from './util/ObjectUnsubscribedError';
import {asap} from './scheduler/asap';
import {async} from './scheduler/async';
import {queue} from './scheduler/queue';
import {AsapScheduler} from './scheduler/AsapScheduler';
import {AsyncScheduler} from './scheduler/AsyncScheduler';
import {QueueScheduler} from './scheduler/QueueScheduler';
import {rxSubscriber} from './symbol/rxSubscriber';
/* tslint:enable:no-unused-variable */

/* tslint:disable:no-var-keyword */
var Scheduler = {
asap,
async,
queue
};

Expand Down
10 changes: 10 additions & 0 deletions src/scheduler/AsyncScheduler.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import {Action} from './Action';
import {FutureAction} from './FutureAction';
import {Subscription} from '../Subscription';
import {QueueScheduler} from './QueueScheduler';

export class AsyncScheduler extends QueueScheduler {
scheduleNow<T>(work: (x?: any) => Subscription, state?: any): Action {
return new FutureAction(this, work).schedule(state, 0);
}
}
3 changes: 3 additions & 0 deletions src/scheduler/async.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import {AsyncScheduler} from './AsyncScheduler';

export const async = new AsyncScheduler();

0 comments on commit 4486c1f

Please sign in to comment.