Skip to content

Implement buffering policies for callback streams #429

@harendra-kumar

Description

@harendra-kumar

#428 introduced callback streams. Currently the callback adds a value to the stream in a non-blocking manner and goes away. If the callback runs too often the buffer may grow in an unbounded manner causing memory hog issues.

We can limit the buffer size of such streams and apply the following policies controlled by the API:

  1. Blocking: block the callback if the buffer limit exceeds
  2. Drop new: drop the latest elements and let the callback proceed
  3. Drop old: drop the oldest element in the buffer and let the callback proceed

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions