Skip to content

Commit

Permalink
refactor: add private access control to lock isolated values
Browse files Browse the repository at this point in the history
  • Loading branch information
grdsdev committed Apr 6, 2024
1 parent 97d1900 commit 41779d4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Sources/PostgREST/PostgrestClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public final class PostgrestClient: Sendable {
}
}

let _configuration: LockIsolated<Configuration>
private let _configuration: LockIsolated<Configuration>
public var configuration: Configuration { _configuration.value }

/// Creates a PostgREST client with the specified configuration.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Realtime/V2/CallbackManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class CallbackManager: @unchecked Sendable {
var callbacks: [RealtimeCallback] = []
}

let mutableState = LockIsolated(MutableState())
private let mutableState = LockIsolated(MutableState())

@discardableResult
func addBroadcastCallback(
Expand Down
2 changes: 1 addition & 1 deletion Sources/Realtime/V2/WebSocketClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ final class WebSocket: NSObject, URLSessionWebSocketDelegate, WebSocketClient, @
var stream: SocketStream?
}

let mutableState = LockIsolated(MutableState())
private let mutableState = LockIsolated(MutableState())

init(config: RealtimeClientV2.Configuration) {
realtimeURL = config.realtimeWebSocketURL
Expand Down
2 changes: 1 addition & 1 deletion Sources/_Helpers/EventEmitter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public final class ObservationToken: Sendable {
package final class EventEmitter<Event: Sendable>: Sendable {
public typealias Listener = @Sendable (Event) -> Void

let listeners = LockIsolated<[ObjectIdentifier: Listener]>([:])
private let listeners = LockIsolated<[ObjectIdentifier: Listener]>([:])
public let lastEvent: LockIsolated<Event>

let emitsLastEventWhenAttaching: Bool
Expand Down

0 comments on commit 41779d4

Please sign in to comment.