-
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: event arg filtering #55
base: main
Are you sure you want to change the base?
Conversation
Tested this and got pretty good results! Add some test cases, and this is probably close to merge |
There are no tests yet in this repo. Perhaps that should be a separate project? |
One issue noted during testing: if you have multiple tasks against the same event/filter arg combo (same named filter arg but different filter values) the second one does not appear to function This can be potentially resolved in another PR (breaking change) that should make it so there can be multiple handlers defined for a specific subscription (will make this an issue but the previous problem should be solved in some way here) |
PR #66 resolves the "no duplicate handlers" situation, which makes it easier to solve the issue I noted of missing task registrations |
b9b36c3
to
899b341
Compare
Rebased and made updates to use new stateless TaskData setup TODO:
|
What I did
Adds event filtering by event argument. For example:
Will only handle USDC burn events.
fixes: #54
fixes: SBK-417
How I did it
Expands taskiq task definitions to be input arg & value specific by hashing the inputs and using it as a name suffix. When an event is received, it's checked against known event handlers and their filters (if they exist) before sending them along.
How to verify it
Run the example app. Burn events are not uncommon.
Checklist