Skip to content

singleflight: add OnceGroup struct #96

@kevinburke

Description

@kevinburke

OnceGroup.Do would have the same semantics as Group.Do, but caches and returns the first computed result.

Example: looking up the user id in /etc/passwd for a given username; something you might need to do once and not more than that, since (if) you don't expect the value to change during the life of the process.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions