xqhy1q
Last Updated: December 03, 2018
·
1.618K
· fr0gs

Ember.run.later and setTimeout comparing scenario.

In the Ember internals (Backburner) it can be found that Ember.run.later basically calls setTimeout() under the hood, but respecting the firing order by which other timeouts were added into the queue.
More on it on a blog post soon in www.estebansastre.com

import Ember from 'ember';

export default Ember.Controller.extend({
  appName: "Timers comparison",
  init: function() {
    this._super();
    this.set('myErrCountLater', 0);
    this.set('myErrCountTimeout', 0);
    this.myFunc(0);
    this.myOtherFunc(0);
  },
  myFunc: function(errorCount) {
    if (errorCount < 7) {
      self = this;
            this.set('myErrCountLater', errorCount);
        console.log("Error Count Later is " + errorCount + ", repeating");
      Ember.run.later(this, function () {
        return self.myFunc(errorCount+1);
      }, 1500);
    }
    else {
        console.log("Everything failed");
    }
    },
  myOtherFunc: function(errorCount) {
    if (errorCount < 7) {
      self = this;
      this.set('myErrCountTimeout', errorCount)
      console.log("Error Count Timeout is " + errorCount + ", repeating");
      setTimeout(function() {
        return self.myOtherFunc(errorCount + 1);
      }, 1500);
    }
    else {
      console.log("Everything failed");
    }
  }
});

35 Responses
Add your response

29801

Before ember-concurrency, my team would hit this same acceptance-test-runs-forever problem with Ember.run.later. We worked around it by following 1 of 2 suggestions from emberjs/ember.js#3008: we switched to window.setTimeout and wrapped Ember-specific code in its callback in an Ember.run. This was preferable to the other workaround of maintaining test-specific code in app-code. The only drawback was slightly more code and the non-obviousness of using native window methods, when we tend to reach for Ember methods first. ember-concurrency could abstract this away. What would happen if ember-concurrency switched to window.setTimeout + Ember.run under the hood?
https://showbox.onl/
https://vidmate.onl/
https://mobdro.onl/

8 months ago ·
29861
30029

Showbox offers a clean user interface to give an amazing streaming experience. https://show-box.one/

6 months ago ·
30033

The app that checks all the vulnerabilities on your network. check out!!
https://getwpswpatester.com/

6 months ago ·
30048

You can use Ember.run.later like you would normally use setTimeout

Ember.run.later((function() {
//do something in here that will run in 2 seconds
}), 2000);

I'm not sure of the internals, but I know that integration testing Ember requires that you use run.later (if you don't the test code won't wait for the timeout to finish).
https://mobdro.ooo

6 months ago ·
30083
30084

Juniper Bank gives Juniper Credit Card administrations to a portion of the best associations in the United States.https://creditcardlogin.online/juniper-credit-card/

5 months ago ·
30103

<a href="https://vizertv-apk.com">vizer tv apk download</a>

5 months ago ·
30105
30109
5 months ago ·
30110
30211
5 months ago ·
30225

This was preferable to the other workaround of maintaining test-specific code in app-code. The only drawback was slightly more code and the non-obviousness of using native window methods
https://popcorntimeapk.org/

5 months ago ·
30244

This article must be very helpful for everyone. It was helpful for me too.

5 months ago ·
30248
30367

also visit https://putlockershub.com/ to latest movies stream for free.

4 months ago ·
30375

This was preferable to the other workaround of maintaining test-specific code in app-code.
https://snaptube-downloadapp.com/

4 months ago ·
30399

download all apk file here descargar apk

https://descargar-apks.com

4 months ago ·
30519

Good to see and read this article.. thanks for sharing..

www.terrariumtvforpcwindows.com

3 months ago ·
30633
30736

You can use Ember.run.later like you would normally use setTimeout
The way SetTimeout is normally used, you can use Ember.run.
However, you must try the below mentioned code:-

Ember.run.later((function() {
//do something in here that will run in 2 seconds
}), 2000);

This should work. Let me know if it did.
https://livenettvapk.live

3 months ago ·
30757

Before ember-concurrency, my team would hit this same acceptance-test-runs-forever problem with Ember.run.later. We worked around it by following 1 of 2 suggestions from emberjs/ember.js#3008: we switched to window.setTimeout and wrapped Ember-specific code in its callback in an Ember.run. This was preferable to the other workaround of maintaining test-specific code in app-code. The only drawback was slightly more code and the non-obviousness of using native window methods, when we tend to reach for Ember methods first. ember-concurrency could abstract this away. What would happen if ember-concurrency switched to window.setTimeout + Ember.run under the hood?
https://morpheus-tv.com/

3 months ago ·
30780

Prior to coal simultaneousness, my group would hit this same acknowledgment trials perpetually issue with Ember.run.later.
thanks.
http://tvtapdownloadapp.com/

2 months ago ·
30793

This was preferable to the other workaround of maintaining test-specific code in app-code. The only drawback was slightly more code and the non-obviousness of using native window methods,

http://redboxtvdownloadapp.com/
http://androidpcapps.com/freeflix-hq-apk-install-on-android-windows-roku-fire-tv/

2 months ago ·
30850

Live Net TV For PC: Missing favorite sports game or tv shows is something which we never want to happen with us. ... Live Net TV, one of the best growing online streaming app offers hundreds of working live tv channels to watch. ... Below you will get download links of Bluestacks android ...

2 months ago ·
30909

You can use Ember.run.later like you would normally use setTimeout

Ember.run.later((function() {
//do something in here that will run in 2 seconds
}), 2000);

I'm not sure of the internals, but I know that integration testing Ember requires that you use run.later (if you don't the test code won't wait for the timeout to finish).
https://mylivenettv.com/

about 2 months ago ·
31044
31081

This article must be very helpful for everyone. It was helpful for me too. https://www.popcorntimepro.com/

about 1 month ago ·
31116

To watch the movies in the lesiure time is the best part of the life. Movies are the reflection of
our life, what we see and observe are reflected through the movies. Watching movies in the theatre show
are sometime not possible. To save that bucks and time, we open a free movie streaming app. Basically,
these movie streaming apps are available on the web easily/. Showbox app is a free movie streaming app,
where you can watch the movies for free. Even the latest movies are available for free and that too
in HD quality. This app can be installed and downloaded into Mac, Kindle, Windows and Android devices.
There are certain movies that can't be even watched on the Netflix or Amazon Prime. In that case, Showbox
is a software to watch the movies for free. Download the movies into any format whether it is MP4 or MP3.
Do watch the movies and save your bucks
https://vidmatedownloading.com
https://mobdroshowbox.com

about 1 month ago ·
31132
31191

In Latin America <a href="https://merrychristmas2008.com/">merry christmas 2018 images</a> various native cultures keep the observation of traditions depending on their particular calendars. <a href="https://happynewyear2019i.com/">happy new year 2019 images</a>

28 days ago ·
31192

The widespread established adoption of the Gregorian https://happynewyear2019i.com/ calendar and marking https://merrychristmas2008.com/ January 1

28 days ago ·
31253
31285

Download Showbox for PC http://showbox-all.com

15 days ago ·
31353

There is am application which let you watch online TV
https://tvtapapk.info/latest-version-of-tvtap-pro-apk-for-android/

about 14 hours ago ·