Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>We moved any calls that could take longer than one or two seconds to a prioritized queue to be processed asynchronously. We use <a href="http://github.com/collectiveidea/delayed_job" rel="nofollow noreferrer">delayed_job (the collectiveidea branch)</a> to handle all background jobs, but another that is getting popular these days is <a href="http://github.com/defunkt/resque" rel="nofollow noreferrer">resque</a>, I have not used it and cannot speak to it other that its basic function.</p> <p>From there you can use ajax to poll the status of the job while you show a progress bar or a spinner or a can eating a baked potato - until the job finishes. This way the background job processes in the background and your web front end will remain snappy.</p> <p>The flow would be:</p> <ol> <li>User submits Request</li> <li>Request Queued</li> <li>Front end responds</li> <li>Network operation starts</li> <li>Network operation ends</li> <li>Begin polling at customer</li> <li>Background job finished</li> <li>Poll gets response and updates UI</li> </ol> <p>VS.</p> <ol> <li>User submits Request</li> <li>Network operation starts</li> <li>Network operation ends</li> <li>Front end responds</li> </ol> <p>This is a bit more complicated than your standard fare of get/process/display but when you have long-running processes, this is the desired method of handling them. An example in the wild of this is Mint.com. When it updates your bank accounts you can click all over the site and when it is done, you are notified.</p> <p>If you are unable to go this route then you are just going to need to increase the number of processes on your front end to handle incoming requests. We are migrating to <a href="http://github.com/defunkt/unicorn" rel="nofollow noreferrer">unicorn</a> but <a href="http://www.modrails.com/" rel="nofollow noreferrer">passenger</a> should be effective in making sure that your busy workers do not get new requests. I recommend this only as a last resort - your requests should all respond in a second or at the most two and everything else should go to a background job processor.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload