Skip to content

how to stop from further parsing in a module or across all modules? #1590

Answered by JCMais
sr105 asked this question in Q&A
Discussion options

You must be logged in to vote

According to this check:

hubot/src/robot.js

Lines 312 to 320 in d0c13d2

listener.call(context.response.message, this.middleware.listener, function (listenerExecuted) {
anyListenersExecuted = anyListenersExecuted || listenerExecuted
// Defer to the event loop at least after every listener so the
// stack doesn't get too big
process.nextTick(() =>
// Stop processing when message.done == true
done(context.response.message.done)
)
})

You can have:

      res.message.done = true

inside your listener callback.

But this only works if your callbacks are not async, I think this is a major drawback of this architecture, it would be better if…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by joeyguerra
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1467 on April 18, 2023 13:32.