Open markmandel opened 4 years ago
I'm adding this as a task for the load balancer, as we need to have the ability to block some packets on proceeding until we have validated some piece of the packet from a request from an external resource without also dropping them in the process.
It's either that or we have filters which call Runtime::block_on
inside their implementations to call async APIs. Which seems like an anti-pattern.
Be able to have a filter that is processed Asynchronously.
This wouldn't have the ability to block, or route requests, but would allow for processing and parsing of packets not on the critical path.
We could also provide options to have a "sample-rate" in which you could retrieve a percentage of packets, either randomly, or deliberately sequentially, for systems that don't need to query every packet to process.
The main use case I can think of is doing something like deep introspection of packets for malicious elements - taking a random sample of packets for processing, could be fast enough to find a bad actor without them being able to cause large scale harm, without slowing down processing speed drastically.