You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hemera.add({topic: 'math',cmd: 'add',a: Joi.number().required(),b: Joi.number().required()}).use(asyncfunction({ payload },reply){// I want to return the response here, not in the `end` method.reply.send(180)}).end(asyncfunction(req){hemera.log.warn("This should not be called, because we are replying in the middleware")returnreq.a+req.b;});
With the callback approach this doesn't happen, because you can skip the call to next().
The text was updated successfully, but these errors were encountered:
Hi @StarpTech. According to the solution you gave me in #240, I implemented a middleware using
async/await
to early reply a message.The problem is that the chain doesn't stop there, and the actual response handler gets executed. An example of this can be found at https://repl.it/repls/ScaredPassionateLifecycles:
With the callback approach this doesn't happen, because you can skip the call to
next()
.The text was updated successfully, but these errors were encountered: