Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer extends a buffered writer that executed itself asynchronously. It uses a timer to flush the buffered writer it it gets stale. Errors that occur during the flush are returned on the next call to Write, Flush or WriteAndFlush.
func NewWriter ¶
NewWriter wraps the provided writer and enables buffering and asynchronous flushing using the specified maximum delay.
Note: The delay should not be below 1ms to prevent flushing every write asynchronously.
func NewWriterSize ¶
NewWriterSize wraps the provided writer and enables buffering and asynchronous flushing using the specified maximum delay. This method allows configuration of the initial buffer size. Note: The delay should not be below 1ms to prevent flushing every write asynchronously.
func (*Writer) SetMaxDelay ¶ added in v0.2.0
SetMaxDelay can be used to adjust the maximum delay of asynchronous executed.
Note: The delay should not be below 1ms to prevent flushing every write asynchronously.