SendablePutSignalingNotifyMetadataItem
public enum SendablePutSignalingNotifyMetadataItem<
Metadata: Decodable & Sendable, Value: Encodable & Sendable
>: SendableRPCMethodProtocol
シグナリング通知メタデータのアイテムを設定する Sendable な RPC メソッド
Metadata / Value が Sendable な場合に MediaChannel.sendableRPC から呼び出せます。
既存 PutSignalingNotifyMetadataItem との使い分けは上のコメントを参照してください。
使用例
struct NotifyResponse: Decodable, Sendable {
let key: String
let value: String
}
do {
let response = try await mediaChannel.sendableRPC(
method: SendablePutSignalingNotifyMetadataItem<NotifyResponse, String>.self,
params: PutSignalingNotifyMetadataItemParams(key: "status", value: "ready")
)
if let result = response?.result {
print("Set metadata item - key: \(result.key), value: \(result.value)")
}
} catch {
print("Failed to set metadata item: \(error)")
}
-
Declaration
Swift
public typealias Params = PutSignalingNotifyMetadataItemParams<Value> -
Declaration
Swift
public typealias Result = Metadata -
Declaration
Swift
public static var name: String { get }
View on GitHub
Install in Dash