Skip to content

reuseTokenSource.Token fastpath #793

@rkuska

Description

@rkuska

While checking the implementation for reuseTokenSource to write my own TokenSource I noticed that it is using sync.Mutex to guard the access to saved token. But given the Token (under heavy use) is mostly reused maybe the implementation would benefit from using sync.RWMutex and adding a fast path (leveraging read lock) to Token when token is valid.

I am willing to implement this improvement.

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