Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8172369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T21:46:00+00:00 2026-06-06T21:46:00+00:00

The context We have an Ember-based app which handles large amount of structured data

  • 0

The context

  • We have an Ember-based app which handles large amount of structured data (Business process models).
  • Important! We would really like to keep our app offline-able, as far as possible.

The need

While we only have to display these data, edit them, and so on, there is no show-stopper in the radar…

But now, we want to apply processing on these models: validity checking, paths finding… and several kind of time/memory consuming algorithms.

The problem

We could process algorithms on the server, but that would kill the app’s offline mode.

We have thought about web workers to avoid freezing application and process algorithms in the background, but we faced a major issue: data duplication when passing the data to the worker.
Using Transferable Objects would make the app lose the ownership (and the data) during at least the computation, so it does not seem viable.

How would you handle this problem? Is our only way out the use of a “coroutine-like” implementation of our algorithms? Any clue?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T21:46:02+00:00Added an answer on June 6, 2026 at 9:46 pm

    If your major concern is not to freeze UI during lengthy javascript processing you developed, you can refactor loop bodies into sequential steps, such that each step call its next by using window.setTimeout. This technique allows the (single) thread to process UI events between each interaction:

    var pr = function(x) {console.log(x)};
    var COUNT=3;
    
    // original regular javascript loop
    for(var i=0; i<COUNT; i++) {
      var msg = "current index is (" + i + ")";
      pr(msg);
    }
    
    // step-by-step sequential calls
    var body = function(i) {
      var msg = "non-blocking for: index is (" + i + ")";
      pr(msg);
    }
    nonBlockingFor(body, 4);
    

    The function nonBlockingFor calls the first argument (as a function) the number of times passed as second argument. It’s definition follows:

    // function constructor
    var nonBlockingFor = (function() {
      function _run(context) {
        if(context.idx > context.max) return;
        context.fnc(context.idx++);
        window.setTimeout((function(){ _run(context)}), 1);
      }
      return (function _start(ufn, uqt, runId) {
        _run({idx: 0, max: uqt -1, fnc: ufn || (function(){}), runId: runId});
      });
    })();
    

    Please note that this is a very simplified function and it can be improved to handle other multi-thread related issues — i.e: waiting for the threads to finish (join). I hope this code helps you. Please let me know if you like this approach to the problem, I could spend some time improving my suggestion, if you like.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying out Ember.js with ember-data, and I have the following application defined: window.App
I have a context loader class which loads an XML file with info on
I have a dynamic page (say myFlashContainer.jsp) which renders different Flash content based on
I have an Ember.js app as follows (borrowed from this article on andyMatthews.net): View:
I have an Ember.Button which should remove an element from an array. The button
Context: An ongoing problem we have been facing is unit testing our market data
I am trying to migrated my app to using Ember-Data as it's persistence mechanism.
Context I have this piece of Java Code btn.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent
Context I have a live running redis-server. I want to make a backup. Idea:
Context We have a SharePoint site set up on a Windows Server 2008 VM

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.