ipfs-inactive/interface-js-ipfs-core

swarm.connect timeout?

achingbrain opened this issue · 2 comments

It would be really useful to have a timeout when trying to dial a remote peer.

await ipfs.swarm.connect(multiaddr, {
  timeout: 5000 // ms
})
// if the timeout is reached, throw and error with a .code property with the value 'ETIMEOUT'

We really need to get the Cancellable Requests / Timeouts story on. I hear that async/wait & promises make that so much easier :) => #58

Let's follow up on timeouts on #58