The default background batching implementation will truncate all unprocessed events if it fills up. This is to prevent logging from blocking up the works, and based on the assumption that newer events are more important than older ones.
This isn't suitable for using the batcher for auditing or proxying use-cases so this PR introduces a function that emitters can use to block waiting for the current batch to be flushed if it's full instead of truncating. If this times out instead of adding the event then it's returned to the caller, who can then discard it or issue a destructive non-blocking send instead.
Closes #68
The default background batching implementation will truncate all unprocessed events if it fills up. This is to prevent logging from blocking up the works, and based on the assumption that newer events are more important than older ones.
This isn't suitable for using the batcher for auditing or proxying use-cases so this PR introduces a function that emitters can use to block waiting for the current batch to be flushed if it's full instead of truncating. If this times out instead of adding the event then it's returned to the caller, who can then discard it or issue a destructive non-blocking send instead.