Skip to content
Snippets Groups Projects

XXMessengerClient

Merged Dariusz Rybicki requested to merge feature/messenger-client into development
3 files
+ 107
0
Compare changes
  • Side-by-side
  • Inline
Files
3
import XXClient
import XCTestDynamicOverlay
public struct MessengerStart {
public enum Error: Swift.Error {
case notLoaded
}
public var run: (Int) throws -> Void
public func callAsFunction(
timeoutMS: Int = 30_000
) throws {
try run(timeoutMS)
}
}
extension MessengerStart {
public static func live(_ env: MessengerEnvironment) -> MessengerStart {
MessengerStart { timeoutMS in
guard let cMix = env.ctx.getCMix() else {
throw Error.notLoaded
}
guard cMix.networkFollowerStatus() != .running else {
return
}
try cMix.startNetworkFollower(timeoutMS: timeoutMS)
}
}
}
extension MessengerStart {
public static let unimplemented = MessengerStart(
run: XCTUnimplemented("\(Self.self)")
)
}
Loading