You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
is it possible to implement a buffer that accumulates logs and then writes to file ( either after N number of logs accumulated OR after certain elapse of timer ) using a thread asynchronously ? Could you please provide some insights on how / where in the code can this be achieved?
The text was updated successfully, but these errors were encountered:
Of course it's possible. But you have to understand what and why you're doing.
Here are some points to consider:
completely removing file operations from the Performance sample makes the code about 2 times faster (on the ordinary PC)
accumulated logs will be lost in case of an application crash
some platforms may have no threads
The best way is to make Record copyable and to create an asynchronous appender-wrapper that will accumulate records and send them to the real appender asynchronously:
Just my 2Cents:
How about taking the first part of the title: Buffered
And adding that to the util::File as an optional parameter (of say 4k increments).
And then setting the buffer used by the wsopen handle if it is greater then 0 ?
Another few cents.
For the Asynch part:
How about just having the "write" part being sent to an async lambda ? (Like async writes in C# etc.) ?
This way, the rest of the code can stay as it is, (i.e. no need to make copy constructors etc), and only the "Slow disk / Ip transport etc) stuff is asynch in "Maybe" a fire and forget fashion ?
is it possible to implement a buffer that accumulates logs and then writes to file ( either after N number of logs accumulated OR after certain elapse of timer ) using a thread asynchronously ? Could you please provide some insights on how / where in the code can this be achieved?
The text was updated successfully, but these errors were encountered: