mirror of
https://github.com/samsonjs/AsyncMonitor.git
synced 2026-03-25 08:25:47 +00:00
20 lines
420 B
Swift
20 lines
420 B
Swift
import AsyncMonitor
|
|
|
|
class TestCancellable: AsyncCancellable {
|
|
lazy var id = ObjectIdentifier(self)
|
|
var isCancelled = false
|
|
|
|
func cancel() {
|
|
isCancelled = true
|
|
}
|
|
|
|
// MARK: Hashable conformance
|
|
|
|
public static func == (lhs: TestCancellable, rhs: TestCancellable) -> Bool {
|
|
lhs.id == rhs.id
|
|
}
|
|
|
|
public func hash(into hasher: inout Hasher) {
|
|
hasher.combine(id)
|
|
}
|
|
}
|