lumberjack icon indicating copy to clipboard operation
lumberjack copied to clipboard

Stream.write can block

Open sdemjanenko opened this issue 6 years ago • 1 comments

When flushing the buffer to a stream it is possible that the call to stream.write can block (https://github.com/bdurand/lumberjack/blob/04b44186433223d110dc95374851e26b888a8855/lib/lumberjack/device/writer.rb#L111) such as if the disk is loaded or if the file is locked.

It would be great if this could be configured to schedule or try to write but not block, or not block for too long.

sdemjanenko avatar Dec 03 '19 01:12 sdemjanenko

Would it make sense to allow stream.sync to be configurable: https://github.com/bdurand/lumberjack/blob/master/lib/lumberjack/device/writer.rb#L62

sdemjanenko avatar Dec 04 '19 20:12 sdemjanenko