docs: add DialRequest description

This commit is contained in:
Jacob Heun 2019-12-06 18:43:59 +01:00
parent 962081f448
commit 43b98e64b6
No known key found for this signature in database
GPG Key ID: CA5A94C15809879F

View File

@ -11,7 +11,11 @@ const pAny = require('p-any')
class DialRequest {
/**
*
* Manages running the `dialAction` on multiple provided `addrs` in parallel
* up to a maximum determined by the number of tokens returned
* from `dialer.getTokens`. Once a DialRequest is created, it can be
* started using `DialRequest.run(options)`. Once a single dial has succeeded,
* all other dials in the request will be cancelled.
* @param {object} options
* @param {Multiaddr[]} options.addrs
* @param {function(Multiaddr):Promise<Connection>} options.dialAction