[ 
https://issues.apache.org/jira/browse/AURORA-700?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14130621#comment-14130621
 ] 

David McLaughlin commented on AURORA-700:
-----------------------------------------

It's how we are using it. E.g. here is the generated body for a API method:

{code}
ReadOnlySchedulerClient.prototype.getPendingReason = function(query, callback) {
    if (callback === undefined) {
      this.send_getPendingReason(query);
      return this.recv_getPendingReason();
    } else {
      var postData = this.send_getPendingReason(query, true);
      return this.output.getTransport()
        .jqRequest(this, postData, arguments, this.recv_getPendingReason);
    }
};
{code}

If there is a callback passed, it just sends off a jQuery.ajax request and 
executes the callback when it's done. If not, it does a synchronous send/recv 
workflow.

We'd need to change all of the code to pass callbacks, which is a bit of a 
paradigm shift from how the code is structured right now (we'd also need to 
think about how this plays with the whole angular promise concept). 

> Scheduler UI should use asynchronous HTTP requests
> --------------------------------------------------
>
>                 Key: AURORA-700
>                 URL: https://issues.apache.org/jira/browse/AURORA-700
>             Project: Aurora
>          Issue Type: Task
>          Components: Scheduler
>            Reporter: David McLaughlin
>
> Currently the scheduler UI code was written to assume synchronous network 
> requests - every API call blocks JS execution. This is really going to limit 
> how many API calls we can make per controller before performance is 
> noticeably degraded. Especially with features like the new update API and the 
> pending reasons API call. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to