Ember.run.schedule()

schedule (queue, target, method, arguments*) *public Defined in packages/ember-metal/lib/run_loop.js:230 Adds the passed target/method and any optional arguments to the named queue to be executed at the end of the RunLoop. If you have not already started a RunLoop when calling this method one will be started for you automatically. At the end of a RunLoop, any methods scheduled in this way will be invoked. Methods will be invoked in an order matching the named queues defined in the run.queue

Ember.run.queues

queuesArrayprivate Defined in packages/ember-metal/lib/run_loop.js:218 Array of named queues. This array determines the order in which queues are flushed at the end of the RunLoop. You can define your own queues by simply adding the queue name to this array. Normally you should not need to inspect or modify this property. Default: ['sync', 'actions', 'destroy']

Ember.run.once()

once (target, method, args*) Objectpublic Defined in packages/ember-metal/lib/run_loop.js:341 Schedule a function to run one time during the current RunLoop. This is equivalent to calling scheduleOnce with the "actions" queue. Parameters: target [Object] The target of the method to invoke. method Function|String The method to invoke. If you pass a string it will be resolved on the target at the time the method is invoked. args* [Object] Optional arguments to pass to the timeout

Ember.run.next()

next (target, method, args*) Objectpublic Defined in packages/ember-metal/lib/run_loop.js:425 Schedules an item to run from within a separate run loop, after control has been returned to the system. This is equivalent to calling run.later with a wait time of 1ms. run.next(myContext, function() { // code to be executed in the next run loop, // which will be scheduled after the current one }); Multiple operations scheduled with run.next will coalesce into the same later run loop, along w

Ember.run.later()

later (target, method, args*, wait) *public Defined in packages/ember-metal/lib/run_loop.js:311 Invokes the passed target/method and optional arguments after a specified period of time. The last parameter of this method must always be a number of milliseconds. You should use this method whenever you need to run some action after a period of time instead of using setTimeout(). This method will ensure that items that expire during the same script execution cycle all execute together, which is

Ember.run.join()

join (target, method, args*) Objectpublic Defined in packages/ember-metal/lib/run_loop.js:82 If no run-loop is present, it creates a new one. If a run loop is present it will queue itself to run on the existing run-loops action queue. Please note: This is not for normal usage, and should be used sparingly. If invoked when not within a run loop: run.join(function() { // creates a new run-loop }); Alternatively, if called within an existing run loop: run(function() { // creates a new run

Ember.run.end()

endVoidpublic Defined in packages/ember-metal/lib/run_loop.js:199 Ends a RunLoop. This must be called sometime after you call run.begin() to flush any deferred actions. This is a lower-level way to use a RunLoop instead of using run(). run.begin(); // code to be executed within a RunLoop run.end(); Returns: Void

Ember.run.debounce()

debounce (target, method, args*, wait, immediate) Arraypublic Defined in packages/ember-metal/lib/run_loop.js:552 Delay calling the target method until the debounce period has elapsed with no additional debounce calls. If debounce is called again before the specified time has elapsed, the timer is reset and the entire period must pass again before the target method is called. This method should be used when an event may be called multiple times but the action should only be called once when

Ember.run.cancel()

cancel (timer) Booleanpublic Defined in packages/ember-metal/lib/run_loop.js:493 Cancels a scheduled item. Must be a value returned by run.later(), run.once(), run.scheduleOnce(), run.next(), run.debounce(), or run.throttle(). let runNext = run.next(myContext, function() { // will not be executed }); run.cancel(runNext); let runLater = run.later(myContext, function() { // will not be executed }, 500); run.cancel(runLater); let runScheduleOnce = run.scheduleOnce('afterRender', myCont

Ember.run.bind()

bind (target, method, args*) Functionpublic Defined in packages/ember-metal/lib/run_loop.js:124 Available since 1.4.0 Allows you to specify which context to call the specified function in while adding the execution of that function to the Ember run loop. This ability makes this method a great way to asynchronously integrate third-party libraries into your Ember application. run.bind takes two main arguments, the desired context and the function to invoke in that context. Any additional argu