Skip to content

Change ConfigVariableReader from a struct to a class#10

Merged
prachigauriar merged 1 commit intomainfrom
prachi/config-variable-reader-class
Mar 6, 2026
Merged

Change ConfigVariableReader from a struct to a class#10
prachigauriar merged 1 commit intomainfrom
prachi/config-variable-reader-class

Conversation

@prachigauriar
Copy link
Copy Markdown
Contributor

  • Add a private MutableState struct to hold mutable state behind a
    Mutex, making ConfigVariableReader Sendable. This enables variable
    registration after the reader has been shared with other components.
  • Mark ConfigVariableReader as a final class and add a computed
    registeredVariables property that reads through the mutex.
  • Change register from a mutating function to a non-mutating one that
    writes through the mutex.

  - Add a private MutableState struct to hold mutable state behind a
    Mutex, making ConfigVariableReader Sendable. This enables variable
    registration after the reader has been shared with other components.
  - Mark ConfigVariableReader as a final class and add a computed
    registeredVariables property that reads through the mutex.
  - Change register from a mutating function to a non-mutating one that
    writes through the mutex.
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 6, 2026

Code Coverage Report

Overall Coverage: 99.58% (1,887 of 1,895)

DevConfiguration: 99.58% (1,887 of 1,895)
File Coverage Covered Lines Executable Lines
CodableValueRepresentation.swift 100.00% 74 74
ConfigVariable.swift 100.00% 68 68
ConfigVariableAccessFailedEvent.swift 100.00% 4 4
ConfigVariableAccessSucceededEvent.swift 100.00% 5 5
ConfigVariableContent.swift 100.00% 1,488 1,488
ConfigVariableDecodingFailedEvent.swift 100.00% 5 5
ConfigVariableMetadata.swift 100.00% 30 30
ConfigVariableReader.swift 95.70% 178 186
EventBusAccessReporter.swift 100.00% 32 32
RegisteredConfigVariable.swift 100.00% 3 3

@prachigauriar prachigauriar merged commit 3cb0757 into main Mar 6, 2026
3 checks passed
@prachigauriar prachigauriar deleted the prachi/config-variable-reader-class branch March 6, 2026 05:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant