multiple handlers #387
Replies: 2 comments
-
Thanks for opening! Early on, I decided to validate against multiple handlers for the same event because there was no clear way to establish a deterministic order for running them. Could you share what you mean by "they're independent"? Would be helpful to understand the specific scenario to see how it generalizes. |
Beta Was this translation helpful? Give feedback.
-
in my case, in one handler i'm watching nft transfers in order to keep track of who owns what tokens, and in the other handler i'm tabulating volume of transfers over time. obviously the logic for this could live in the same handler, but it felt cleaner to separate them out. technically my second handler does reference entities created in the first handler (namely an address' |
Beta Was this translation helpful? Give feedback.
-
Error while building handlers: Cannot add multiple handler functions for event: MyNFT:TransferBatch
would be nice — currently i'm just using one handler and
await Promise.all([])
to parallelize them, since they're independent. not sure if the expectation is that multiple handlers would be run in parallel or that they'd be run in serial based on order. also gets confusing if you have multiple handlers in different files, since inclusion order would but unintuitive. perhaps instead of a ponder feature this is more of a userspace feature where someone can provide acompose
function alaor something like that
Beta Was this translation helpful? Give feedback.
All reactions