Back Midas Rome Roody Rootana
  Midas DAQ System  Not logged in ELOG logo
Entry  29 Oct 2015, Konstantin Olchanski, Info, synchronous ajax deprecated 
    Reply  29 Oct 2015, Amy Roberts, Info, synchronous ajax deprecated 
       Reply  30 Oct 2015, Stefan Ritt, Info, synchronous ajax deprecated 
          Reply  18 Nov 2015, Amy Roberts, Info, synchronous ajax deprecated 
             Reply  18 Nov 2015, Konstantin Olchanski, Info, synchronous ajax deprecated 
                Reply  19 Nov 2015, Amy Roberts, Info, synchronous ajax deprecated 
       Reply  02 Nov 2015, Konstantin Olchanski, Info, synchronous ajax deprecated 
          Reply  17 Nov 2015, Konstantin Olchanski, Info, synchronous ajax deprecated 
             Reply  18 Nov 2015, Amy Roberts, Info, synchronous ajax deprecated 
                Reply  26 Nov 2015, Konstantin Olchanski, Info, browser compatibility test: synchronous ajax deprecated 
                Reply  27 Nov 2015, Konstantin Olchanski, Info, synchronous ajax deprecated 
Message ID: 1131     Entry time: 02 Nov 2015     In reply to: 1129     Reply to this: 1136
Author: Konstantin Olchanski 
Topic: Info 
Subject: synchronous ajax deprecated 
> We're using mhttpd for calls that end up working better with asynchronous requests, and we've built up sort of a parallel, asynchronous library using javascript Promises.
> 
> The Promises (which are in the ES6 spec) have worked incredibly well for building well-behaved, sequential calls to mhttpd.  Personally, I also find their syntax much easier to wrap my
> head around, especially compared to callbacks.
> 

Yes, the javascript wrappers for the json-rpc interface follow the Promise pattern - an RPC call is provided with two user functions,
one is called on success (and provides the rpc reply), the other on failure (and provides all rpc call information - the xhr object, any exception context, etc).

Use of the Promise class itself seems to be problematic - apparently it does not exist in google chrome 28 (the last version for RHEL/CentOS/SL6).

SL6 is still our main workhorse and it is good to have a choice of 2 browsers (old google chrome vs old firefox).

(All SL5 web browsers are already unusable with the modern web and current mhttpd.)

(Also the RPC calls have more than 1 item of data permitted by the javascript Promise class - of course it can be wrapped
be a container object - just an extra complication to document and to understand).

K.O.
ELOG V3.1.4-2e1708b5