Skip to content

time: Timer.Stop documentation not covering all the cases #35627

@ikalyvas

Description

@ikalyvas

Hello,
In the section where the Stop method of a timer object is described there is a snippet about ensuring to drain the channel in case this method returns False.
However, it does not mention explicitly that this code snippet works only when the Stop returns False in case the timer has already expired. Because only in this case the channel read will not block.
If the timer is already stopped , this operation will block indefinitely, therefore will not drain the channel since no value will be ever sent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.FrozenDueToAgeWaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions