2016-05-24 20 views
1

Die async documentation zeigt eine retryable Beispiel für async.auto aber ich frage mich, wie das Muster für async.waterfall aussieht? Ich konnte keine Beispiele finden. Wäre es in etwa so aussehen:Was ist das asynchrone Muster für asyncwasserfall?

async.waterfall([ 
    step1, 
    step2, 
    async.retryable([opts = {times: 5, interval: 3000}], step3), 
    step4 
    ], 
    function(error, result) { 
     if (error) { console.error(error); return; 
     } console.log(result); 
    }); 

Antwort

0

In weitere Recherchen habe ich bestätige dies das richtige Muster für async.retryable im Zusammenhang mit async.waterfall unten (Schritt 3):

async.waterfall([ 
    step1, 
    step2, 
    async.retryable([opts = {times: 5, interval: 3000}], step3), 
    step4 
    ], 
    function(error, result) { 
     if (error) { console.error(error); return; 
     } console.log(result); 
    }); 
Verwandte Themen