Skip to content

Should withSnapshot be just snapshot() -> ConfigSnapshotReader? #78

@czechboy0

Description

@czechboy0

Since ConfigSnapshotReader is being sent through async sequences, we can't take advantage of any non-copyable/non-escapable optimizations on it, which brings the ConfigReader.withSnapshot method into question - why is it a with-style method, when simply returning a snapshot reader would work just fine? ConfigProvider.snapshot() already has this spelling.

This would be a benefit for consistency, because there isn't any reason the ConfigSnapshotReader needs to be scoped, this API shape came from an earlier experiment where we thought we could use a non-copyable/non-escapable type. But right now it's not providing any benefits and is just providing a slightly less ergonomic API for users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/usabilityUsability of generated code, ergonomics.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions