Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  bug1769155.sjs   Sprache: unbekannt

 
function waitForTrue(state) {
  return new Promise(resolve => {
    let timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
    timer.init(
      () => {
        if (getState(state) == "true") {
          timer.cancel();
          resolve();
        }
      },
      400,
      Ci.nsITimer.TYPE_REPEATING_SLACK
    );
  });
}
function handleRequest(request, response) {
  response.processAsync();

  if (request.queryString != "stop") {
    // This is called from a synchronous XHR that we want to block until
    // we get a stop notification.
    waitForTrue("stop").then(() => {
      response.write("");
      response.finish();

      // Signal the other connection that we've closed the connection
      // for the synchronous XHR.
      setState("stopped", "true");
    });
  } else {
    // Close the connection for the synchronous XHR.
    setState("stop", "true");

    // Let's wait until we've actually closed the connection for the XHR.
    waitForTrue("stopped").then(() => {
      response.write("");
      response.finish();
    });
  }
}

[ Dauer der Verarbeitung: 0.4 Sekunden  (vorverarbeitet)  ]

                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge