shotover / shotover-proxy

L7 data-layer proxy
https://docs.shotover.io
Apache License 2.0
82 stars 16 forks source link

Coalesce transform - implement true flush_when_millis_since_last_flush #1673

Open rukai opened 4 weeks ago

rukai commented 4 weeks ago

Previously shotover's design did not allow for a true implementation of flush_when_millis_since_last_flush. There was no way for the transform to trigger a flush all on its own, it had to wait for a new request to come in before the flush could be triggered.

This results in easily triggered poor behavior, for example:

However shotover now supports this kind of functionality via force_run_chain. So we should reimplement the flush_when_millis_since_last_flush logic of Coalesce to setup a tokio task in the background that will trigger a flush after the time has passed.

This should be done by: