mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
25 lines
726 B
Swift
25 lines
726 B
Swift
|
// Copyright © 2022 Rangeproof Pty Ltd. All rights reserved.
|
||
|
|
||
|
import Foundation
|
||
|
import GRDB
|
||
|
import SignalCoreKit
|
||
|
import SessionUtilitiesKit
|
||
|
|
||
|
public enum GetSnodePoolJob: JobExecutor {
|
||
|
public static let maxFailureCount: Int = -1
|
||
|
public static let requiresThreadId: Bool = false
|
||
|
public static let requiresInteractionId: Bool = false
|
||
|
|
||
|
public static func run(
|
||
|
_ job: Job,
|
||
|
success: @escaping (Job, Bool) -> (),
|
||
|
failure: @escaping (Job, Error?, Bool) -> (),
|
||
|
deferred: @escaping (Job) -> ()
|
||
|
) {
|
||
|
SnodeAPI.getSnodePool()
|
||
|
.done { _ in success(job, false) }
|
||
|
.catch { error in failure(job, error, false) }
|
||
|
.retainUntilComplete()
|
||
|
}
|
||
|
}
|