-
-
Notifications
You must be signed in to change notification settings - Fork 335
Closed
Labels
Description
This is from tracker's point of view.
I am attempting to extend the usage of filter function by e.g. using a database to query whether the torrent has valid infoHash or not, as well as any other params that needs to be checked.
Database queries, as being network requests, are async in nature, and they don't return a value but a callback to do further processing.
Filter function requires a return value (a boolean).
Is there any way that you can think of to easily do both? As I can see it, there's no way to do this cleanly. Using async module or whatnot isn't going to cut it as it's not the order of the processing, but rather inability to return a value from a callback to original caller (which doesn't make sense anyway).