Skip to content

Commit 4b582a1

Browse files
authored
Add Sendable for internal callbacks (#686)
1 parent 4e94626 commit 4b582a1

File tree

6 files changed

+6
-7
lines changed

6 files changed

+6
-7
lines changed

.nanpa/sendable-callbacks.kdl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
patch type="fixed" "Sendable requirement for internal callbacks"

Sources/LiveKit/Audio/Manager/AudioManager.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ public class AudioManager: Loggable {
3939
_ = shared
4040
}
4141

42-
public typealias OnDevicesDidUpdate = (_ audioManager: AudioManager) -> Void
42+
public typealias OnDevicesDidUpdate = @Sendable (_ audioManager: AudioManager) -> Void
4343

44-
public typealias OnSpeechActivity = (_ audioManager: AudioManager, _ event: SpeechActivityEvent) -> Void
44+
public typealias OnSpeechActivity = @Sendable (_ audioManager: AudioManager, _ event: SpeechActivityEvent) -> Void
4545

4646
#if os(iOS) || os(visionOS) || os(tvOS)
4747

Sources/LiveKit/Core/Room+Engine.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ extension Room {
3737
struct ConditionalExecutionEntry {
3838
let executeCondition: ConditionEvalFunc
3939
let removeCondition: ConditionEvalFunc
40-
let block: () -> Void
40+
let block: @Sendable () -> Void
4141
}
4242

4343
// Resets state of transports

Sources/LiveKit/Core/Transport.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ internal import LiveKitWebRTC
2525
actor Transport: NSObject, Loggable {
2626
// MARK: - Types
2727

28-
typealias OnOfferBlock = (LKRTCSessionDescription) async throws -> Void
28+
typealias OnOfferBlock = @Sendable (LKRTCSessionDescription) async throws -> Void
2929

3030
// MARK: - Public
3131

Sources/LiveKit/Support/Utils.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ internal import LiveKitWebRTC
2020
@_implementationOnly import LiveKitWebRTC
2121
#endif
2222

23-
typealias DebouncFunc = () -> Void
24-
2523
enum OS {
2624
case macOS
2725
case iOS

Sources/LiveKit/Track/Metrics/MetricsManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ extension MetricsManager: TrackDelegate {
5454

5555
/// An actor that converts track statistics into metrics and sends them to the server as data packets.
5656
actor MetricsManager: Loggable {
57-
private typealias Transport = (Livekit_DataPacket) async throws -> Void
57+
private typealias Transport = @Sendable (Livekit_DataPacket) async throws -> Void
5858
private struct TrackProperties {
5959
let identity: LocalParticipant.Identity?
6060
let transport: Transport

0 commit comments

Comments
 (0)