Worker orchestration idea might be overkill
hi,
I need to trigger a processing task inside a worker only 2sec and then once again 10sec after my worker got a POST request.
I want all POST requests that came between 0 and 2 secs to be batch processed as a time ordered batch.
(2s and 10s are arbitrary amounts and could change)
My idea was the following:
• my main worker caches POST requests's payload in a durable object
• main worker then pings an echo worker whose job is nothing more than starting a timer if idle and ignoring all subsequent pings until its timer fires off.
• echo worker pings back main worker who can now process all requests cached in the durable object
am i over-engineering it ?
I need to trigger a processing task inside a worker only 2sec and then once again 10sec after my worker got a POST request.
I want all POST requests that came between 0 and 2 secs to be batch processed as a time ordered batch.
(2s and 10s are arbitrary amounts and could change)
My idea was the following:
• my main worker caches POST requests's payload in a durable object
• main worker then pings an echo worker whose job is nothing more than starting a timer if idle and ignoring all subsequent pings until its timer fires off.
• echo worker pings back main worker who can now process all requests cached in the durable object
am i over-engineering it ?