Support await for `after` method
allevo opened this issue · 2 comments
allevo commented
Hi!
currently the ready
method support the promises. So you can write
await avvioInstance.ready()
console.log('UP!')
It can be useful for after
method too.
await avvioInstance.use(...).after()
await Promise.all([
avvioInstance.use(...).after(),
avvioInstance.use(...).after()
])
...
await avvioInstance.ready()
console.log('UP!')
mcollina commented
Unfortunately that will not be feasible:
avvio.use(async something (i, opts) {
await this.after(func)
// this line will never be executed
})
While await avvio.ready()
make sense because it's top-level only.
BTW, there is no need to await on .use()
.