Skip to content

Commit

Permalink
making provider configurations public initializers
Browse files Browse the repository at this point in the history
  • Loading branch information
heckj committed Apr 11, 2024
1 parent 6fca494 commit 140bec7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ public struct PeerToPeerProviderConfiguration: Sendable {
let peerName: String
let passcode: String

init(reconnectOnError: Bool, listening: Bool, peerName: String?, passcode: String, autoconnect: Bool? = nil) async {
public init(
reconnectOnError: Bool,
listening: Bool,
peerName: String?,
passcode: String,
autoconnect: Bool? = nil
) async {
self.reconnectOnError = reconnectOnError
self.listening = listening
if let auto = autoconnect {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ public actor WebSocketProvider: NetworkProvider {
let reconnectOnError: Bool

public static let `default` = WebSocketProviderConfiguration(reconnectOnError: true)

public init(reconnectOnError: Bool) {
self.reconnectOnError = reconnectOnError
}
}

public var peeredConnections: [PeerConnection]
Expand Down

0 comments on commit 140bec7

Please sign in to comment.