Skip to content

proposal: bufio: Writer.SetFlushTimeout method #20353

@rgooch

Description

@rgooch

Proposal: add a Writer.SetFlushTimeout method which will set a timeout to flush the buffer after a period of inactivity.

Rationale: for performance reasons it's common to not call Flush after every Write. However, in some applications (such as writing messages to a connection or logfiles), timely flushing of data will improve responsiveness or ensure more log data are written prior to a fatal error/panic.

Proposed method signature:
func (w *Writer) SetFlushTimeout(timeout time.Duration) {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureRequestIssues asking for a new feature that does not need a proposal.FrozenDueToAgeNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.Proposal

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions