Skip to content

Commit

Permalink
Formatted files (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
Henryforce authored Apr 28, 2022
1 parent eeb365b commit c263105
Show file tree
Hide file tree
Showing 15 changed files with 636 additions and 557 deletions.
6 changes: 6 additions & 0 deletions FormatScript.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

swift-format format --in-place --recursive Sources --configuration SwiftFormatConfiguration.json

swift-format format --in-place --recursive Tests --configuration SwiftFormatConfiguration.json

4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"repositoryURL": "https://github.com/Henryforce/AsyncTimeSequences",
"state": {
"branch": null,
"revision": "1dbdc4b6c888bd26ec15d5c279d7d0284fae422a",
"version": "0.0.7"
"revision": "14309de5890521b339c2a8b316f1090c07801e2a",
"version": "0.0.9"
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let package = Package(
],
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(url: "https://github.com/Henryforce/AsyncTimeSequences", from: "0.0.7")
.package(url: "https://github.com/Henryforce/AsyncTimeSequences", from: "0.0.9")
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
import Foundation

extension AsyncWebSocketClientProtocol {
public func sendJSONData<T: Encodable>(
_ data: T,
encoder: JSONEncoder = JSONEncoder()
) async throws {
let encodedData = try encoder.encode(data)
try await send(.data(encodedData))
}
public func sendJSONData<T: Encodable>(
_ data: T,
encoder: JSONEncoder = JSONEncoder()
) async throws {
let encodedData = try encoder.encode(data)
try await send(.data(encodedData))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,29 @@
import Foundation

extension AsyncWebSocketClient: URLSessionWebSocketDelegate {
nonisolated public func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didOpenWithProtocol protocol: String?) {
Task {
await socketWasOpened()
}
nonisolated public func urlSession(
_ session: URLSession, webSocketTask: URLSessionWebSocketTask,
didOpenWithProtocol protocol: String?
) {
Task {
await socketWasOpened()
}

nonisolated public func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didCloseWith closeCode: URLSessionWebSocketTask.CloseCode, reason: Data?) {
Task {
await updateStream(with: .socketClosed(nil))
}
}

nonisolated public func urlSession(
_ session: URLSession, webSocketTask: URLSessionWebSocketTask,
didCloseWith closeCode: URLSessionWebSocketTask.CloseCode, reason: Data?
) {
Task {
await updateStream(with: .socketClosed(nil))
}

nonisolated public func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) {
Task {
await socketFailedToOpen()
}
}

nonisolated public func urlSession(
_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?
) {
Task {
await socketFailedToOpen()
}
}
}
Loading

0 comments on commit c263105

Please sign in to comment.