Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Use-case summary: Use PickN when you need to gather a precise number of events from multiple workers.  It  It is unusual for users to use this pattern: it is typically only used internally by AMI.  The ami graph output will update only when N events have been collected.  Note that there is some arithmetic rounding depending on the number of events requested and the number of workers running parallel.

...

RollingBuffer works similarly to the PickN, only it accumulates to a circular buffer, which shifts left after N elements have been accumulated. Unlike the PickN which only returns when N events have collected, the RollingBuffer returns after each event.

For example assume N = 10 and we have 2 workers and 2 localCollectors. The workers and local collectors will both collect 5 events each and the global collector will collect 10 events. Once 10 events have been collected all elements in the list will shift left and the latest event will appear in the buffer at index 9.

...