(opts: {
clientId: string;
reconnectToken: string;
ruleParams?: RuleParams | null | undefined;
})
| 909 | } |
| 910 | |
| 911 | private startWriteStream(opts: { |
| 912 | clientId: string; |
| 913 | reconnectToken: string; |
| 914 | ruleParams?: RuleParams | null | undefined; |
| 915 | }): Promise<WriteStreamStartResult> { |
| 916 | const eventId = uuid(); |
| 917 | let resolve: ((data: WriteStreamStartResult) => void) | null = null; |
| 918 | const promise: Promise<WriteStreamStartResult> = new Promise((r) => { |
| 919 | resolve = r; |
| 920 | }); |
| 921 | this.startWriteStreamCbs[eventId] = resolve!; |
| 922 | const msg: StartStreamMsg = { |
| 923 | op: 'start-stream', |
| 924 | 'client-id': opts.clientId, |
| 925 | 'reconnect-token': opts.reconnectToken, |
| 926 | }; |
| 927 | |
| 928 | if (opts.ruleParams) { |
| 929 | msg['rule-params'] = opts.ruleParams; |
| 930 | } |
| 931 | |
| 932 | this.trySend(eventId, msg); |
| 933 | |
| 934 | return promise; |
| 935 | } |
| 936 | |
| 937 | private registerWriteStream(streamId: string, cbs: WriteStreamCbs) { |
| 938 | this.writeStreams[streamId] = cbs; |
nothing calls this directly
no outgoing calls
no test coverage detected