-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
enhancementNew feature or requestNew feature or request
Description
When creating a SinkAsync object, using the mode op.AsyncMode.QUEUE , this coro queue could basically grow limitlessly. In case the queue is filled up too fast due to a missed edge case and/or limited system resources (e.g., embedded), this could kill the application.
To handle this, I suggest introducing an optional, additional parameter max_queue_threshold to the SinkAsync class. As the name suggests, this is a "threshold" rather than an absolute limit, which would kind of defeat the purpose of the queue mode. In case the length of the CoroQueue exceeds max_queue_threshold , CoroQueue shall emit a RuntimeError. It is the developers' responsibility to
- define a reasonable threshold for their application, which is not too sharp but also keeps the application running safely.
- handle the runtime error. Either use the
default_error_handlerand deliberately throw a system error or useerror_callbackof theSinkAsyncclass for custom handling.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request