Skip to content
Snippets Groups Projects
Commit ee3ce547 authored by Dariusz Rybicki's avatar Dariusz Rybicki
Browse files

Add CMixTrackServicesWithIdentity

parent 790da3ab
No related branches found
No related tags found
2 merge requests!138Notifications,!102Release 1.0.0
This commit is part of merge request !138. Comments created here will be created in the context of that merge request.
...@@ -20,6 +20,7 @@ public struct CMix { ...@@ -20,6 +20,7 @@ public struct CMix {
public var waitForRoundResult: CMixWaitForRoundResult public var waitForRoundResult: CMixWaitForRoundResult
public var connect: CMixConnect public var connect: CMixConnect
public var trackServices: CMixTrackServices public var trackServices: CMixTrackServices
public var trackServicesWithIdentity: CMixTrackServicesWithIdentity
} }
extension CMix { extension CMix {
...@@ -43,7 +44,8 @@ extension CMix { ...@@ -43,7 +44,8 @@ extension CMix {
addHealthCallback: .live(bindingsCMix), addHealthCallback: .live(bindingsCMix),
waitForRoundResult: .live(bindingsCMix), waitForRoundResult: .live(bindingsCMix),
connect: .live(bindingsCMix), connect: .live(bindingsCMix),
trackServices: .live(bindingsCMix) trackServices: .live(bindingsCMix),
trackServicesWithIdentity: .live(bindingsCMix)
) )
} }
} }
...@@ -68,6 +70,7 @@ extension CMix { ...@@ -68,6 +70,7 @@ extension CMix {
addHealthCallback: .unimplemented, addHealthCallback: .unimplemented,
waitForRoundResult: .unimplemented, waitForRoundResult: .unimplemented,
connect: .unimplemented, connect: .unimplemented,
trackServices: .unimplemented trackServices: .unimplemented,
trackServicesWithIdentity: .unimplemented
) )
} }
import Bindings
import XCTestDynamicOverlay
public struct CMixTrackServicesWithIdentity {
public var run: (Int, TrackServicesCallback) throws -> Void
public func callAsFunction(
_ identity: Int,
callback: TrackServicesCallback
) throws -> Void {
try run(identity, callback)
}
}
extension CMixTrackServicesWithIdentity {
public static func live(_ bindingsCMix: BindingsCmix) -> CMixTrackServicesWithIdentity {
CMixTrackServicesWithIdentity { identity, callback in
try bindingsCMix.trackServices(
withIdentity: identity,
cb: callback.makeBindingsHealthCallback()
)
}
}
}
extension CMixTrackServicesWithIdentity {
public static let unimplemented = CMixTrackServicesWithIdentity(
run: XCTUnimplemented("\(Self.self)")
)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment