forked from devMEremenko/XcodeBenchmark
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStarscream.swift
44 lines (33 loc) · 951 Bytes
/
Starscream.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//
// Starscream.swift
// XcodeBenchmark
//
// Created on 18.08.2020.
//
import Starscream
public struct MyEngine: Engine {
private let engine: Engine
public func register(delegate: EngineDelegate) {
engine.register(delegate: delegate)
}
public func start(request: URLRequest) {
engine.start(request: request)
}
public func stop(closeCode: UInt16) {
engine.stop(closeCode: closeCode)
}
public func forceStop() {
engine.forceStop()
}
public func write(data: Data, opcode: FrameOpCode, completion: (() -> ())?) {
engine.write(data: data, opcode: opcode, completion: completion)
}
public func write(string: String, completion: (() -> ())?) {
engine.write(string: string, completion: completion)
}
}
public extension MyEngine {
static func make() -> Engine {
MyEngine(engine: NativeEngine())
}
}