Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
The Ember.js Run Loop
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
rizwanreza
November 13, 2014
32
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
The Ember.js Run Loop
rizwanreza
November 13, 2014
More Decks by rizwanreza
See All by rizwanreza
Database Integrity in Rails
rizwanreza
1
110
Featured
See All Featured
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
790
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
460
Utilizing Notion as your number one productivity tool
mfonobong
4
640
Into the Great Unknown - MozCon
thekraken
41
2.8k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
600
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
580
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
920
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
2
970
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
760
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.9k
Transcript
The Ember.js Run Loop
Coalescing Modularity Performance
“the run loop is a mechanism that Ember.js uses to
group, coordinate, and execute events, key-value notifications, and timers within your application.” From Ember.js in Action
Queues in the Run Loop Sync Actions Render AfterRender Destroy
Ember implements listeners for each of these queues Sync Actions
Render AfterRender Destroy
QUEUE ! ! ! ! ! ! UPDATE EVENTS PREVIOUS
QUEUE NEXT QUEUE Run Loop
Processing each queue can emit events to the proceeding/ preceding
queues
It’s not an infinite loop
Sync Queue: Propagates bound data Sync Actions Render AfterRender Destroy
Actions Queue: Runs Promises Runs Initialization Events Sync Actions Render
AfterRender Destroy
All custom events go to the Actions queue Sync Actions
Render AfterRender Destroy
Render Actions Sync AfterRender Destroy Render Queue: Manipulates DOM Re-renders
views
AfterRender Queue: Handles extra DOM events Actions Sync Destroy AfterRender
Render
Actions Sync Destroy AfterRender Render AfterRender queue is a good
place to initialize jQuery plugins on elements added by the Render queue
Destroy Queue: Garbage-collects views Actions Sync AfterRender Destroy Render
Sync Actions Render AfterRender Destroy
Sync Actions Render AfterRender Destroy {3 isCompleted Events 3 checked
events 3 remainingFormatted 3 markAllDone updates
{3 checkboxes 1 change to status 1 change to “Mark
all as done” Render Actions Sync AfterRender Destroy
Executing code in the Ember Run Loop
$.post(‘/post_cc’, success: function(e) { Ember.run(function() { this.store.createRecord('user', { cardId: e.data.customerId,
planId: 'pro' }); }); }); Executes code immediately by reusing/starting run loop
Ember.run.next(function () { this.set(‘flash’, “Hello world”); }) Executes code in
the next available run loop
Ember.run.later(function () { this.set(‘flash’, “Hello world”); }, 1000) Executes code
in the next available run loop after 1s
Ember.run.schedule('afterRender', this, function () { this.$().tooltip(); }); Schedules in the
“afterRender” queue
Schedules once in the “afterRender” queue Ember.run.scheduleOnce('afterRender', this, function ()
{ this.$().tooltip(); });
Resources
None
None
https://github.com/eoinkelly/ ember-runloop-handbook Ember runloop handbook
Q&A
Thanks! @rizwanreza