5 Commits

Author SHA1 Message Date
Alex Potsides
df6ef45a2d feat: promisify all api methods that accept callbacks (#381)
* feat: promisify all api methods that accept callbacks

This is a stop-gap until the full async/await migration can be
completed.  It means we can refactor tests of other modules that
depend on this module without having to mix async flow control
strategies.

N.b. some methods that were previously callable without callbacks
(e.g. `node.start()`, `node.stop()`, etc) now require callbacks
otherwise a promise is returned which, if rejected, can cause
`unhandledPromiseRejection` events and lead to memory leaks.

* docs: add a global note to the api about promisify

* fix: update the logic for unsubscribe

* test(fix): correct pubsub unsubscribe usage for api change

* test(fix): update content routing tests for latest delegate version
2019-07-29 15:40:40 +02:00
Vasco Santos
de84ee473c chore: add error codes to dht and pubsub errors (#328)
* chore: add error codes to dht and pubsub errors

* fix: code review
2019-02-26 15:15:30 +01:00
Vasco Santos
4460e8246c fix: dht get options 2018-09-24 17:03:43 +02:00
Vasco Santos
69f7264123 fix: add maxtimeout to dht get (#248)
* fix: add maxtimeout to dht get

* chore: add tests
2018-09-19 19:31:36 +02:00
David Dias
6651401f0b feat: dialProtocol and small refactor 2018-02-07 08:37:03 +00:00