mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-04-27 15:17:38 +00:00
17 lines
499 B
Swift
17 lines
499 B
Swift
import Foundation
|
|
|
|
/// Protocol for creating WebSocket instances.
|
|
/// Enables dependency injection and testing of WebSocket functionality.
|
|
@MainActor
|
|
protocol WebSocketFactory {
|
|
func createWebSocket() -> WebSocketProtocol
|
|
}
|
|
|
|
/// Default factory that creates real WebSocket instances.
|
|
/// Creates URLSessionWebSocket instances for production use.
|
|
@MainActor
|
|
class DefaultWebSocketFactory: WebSocketFactory {
|
|
func createWebSocket() -> WebSocketProtocol {
|
|
URLSessionWebSocket()
|
|
}
|
|
}
|