danielzzz / node-ping

a poor man's ping library (using udp scanning) for node
MIT License
336 stars 105 forks source link

Async ping to hosts #93

Closed erolfedakar closed 5 years ago

erolfedakar commented 5 years ago

Hello,

I am trying to make async ping to hosts, in current we are sending ping all at the same time,

so I want to do first try ping to first hosts when getting a reply from first hosts to try second hosts,

in current sending ping to all hosts same time.

mondwan commented 5 years ago

It should work for using with promise ping. In your case, you need something like a waterfall or series implementation. Here is the idea from bluebird

http://bluebirdjs.com/docs/coming-from-other-libraries.html#async.waterfall

Bluebird is simply a library for working with promise object. You can choose whatever promise library you like.