Skip to content

Commit 34cf1b5

Browse files
feature: Remove Messenger.onClose
This should be managed with Server onExit
1 parent 8479bb9 commit 34cf1b5

File tree

2 files changed

+0
-7
lines changed

2 files changed

+0
-7
lines changed

Sources/GraphQLTransportWS/Messenger.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ public protocol Messenger: AnyObject {
88
// AnyObject compliance requires that the implementing object is a class and we can reference it weakly
99
func send<S>(_ message: S) -> Void where S: Collection, S.Element == Character
1010
func onRecieve(callback: @escaping (String) -> Void) -> Void
11-
func onClose(callback: @escaping () -> Void) -> Void
1211
func close() -> Void
1312
func error(_ message: String, code: Int) -> Void
1413
}

Tests/GraphQLTransportWSTests/TestMessenger.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import Foundation
1010
class TestMessenger: Messenger {
1111
weak var other: TestMessenger?
1212
var onRecieve: (String) -> Void = { _ in }
13-
var onClose: () -> Void = { }
1413
let queue: DispatchQueue = .init(label: "Test messenger")
1514

1615
init() {}
@@ -30,16 +29,11 @@ class TestMessenger: Messenger {
3029
self.onRecieve = callback
3130
}
3231

33-
func onClose(callback: @escaping () -> Void) {
34-
self.onClose = callback
35-
}
36-
3732
func error(_ message: String, code: Int) {
3833
self.send("\(code): \(message)")
3934
}
4035

4136
func close() {
4237
// This is a testing no-op
43-
self.onClose()
4438
}
4539
}

0 commit comments

Comments
 (0)