|
1 | 1 | import { EventEmitter } from "events"; |
2 | | -import ClusterAllFailedError from "../errors/ClusterAllFailedError"; |
3 | | -import { defaults, noop, Debug } from "../utils"; |
4 | | -import ConnectionPool from "./ConnectionPool"; |
5 | | -import { |
6 | | - NodeKey, |
7 | | - RedisOptions, |
8 | | - normalizeNodeOptions, |
9 | | - NodeRole, |
10 | | - getUniqueHostnamesFromOptions, |
11 | | - nodeKeyToRedisOptions, |
12 | | - groupSrvRecords, |
13 | | - weightSrvRecords, |
14 | | - getConnectionName, |
15 | | -} from "./util"; |
16 | | -import ClusterSubscriber from "./ClusterSubscriber"; |
17 | | -import DelayQueue from "./DelayQueue"; |
18 | | -import ScanStream from "../ScanStream"; |
| 2 | +import * as commands from "redis-commands"; |
19 | 3 | import { AbortError, RedisError } from "redis-errors"; |
20 | 4 | import asCallback from "standard-as-callback"; |
21 | | -import { CallbackFunction, NetStream } from "../types"; |
22 | | -import { ClusterOptions, DEFAULT_CLUSTER_OPTIONS } from "./ClusterOptions"; |
| 5 | +import { Pipeline } from ".."; |
| 6 | +import Command from "../command"; |
| 7 | +import ClusterAllFailedError from "../errors/ClusterAllFailedError"; |
| 8 | +import Redis from "../Redis"; |
| 9 | +import ScanStream from "../ScanStream"; |
| 10 | +import { CallbackFunction, WriteableStream } from "../types"; |
23 | 11 | import { |
24 | | - sample, |
25 | 12 | CONNECTION_CLOSED_ERROR_MSG, |
| 13 | + Debug, |
| 14 | + defaults, |
| 15 | + noop, |
| 16 | + sample, |
26 | 17 | shuffle, |
27 | 18 | timeout, |
28 | 19 | zipMap, |
29 | 20 | } from "../utils"; |
30 | | -import * as commands from "redis-commands"; |
31 | | -import Command from "../command"; |
32 | | -import Redis from "../Redis"; |
| 21 | +import applyMixin from "../utils/applyMixin"; |
33 | 22 | import Commander from "../utils/Commander"; |
| 23 | +import { ClusterOptions, DEFAULT_CLUSTER_OPTIONS } from "./ClusterOptions"; |
| 24 | +import ClusterSubscriber from "./ClusterSubscriber"; |
| 25 | +import ConnectionPool from "./ConnectionPool"; |
| 26 | +import DelayQueue from "./DelayQueue"; |
| 27 | +import { |
| 28 | + getConnectionName, |
| 29 | + getUniqueHostnamesFromOptions, |
| 30 | + groupSrvRecords, |
| 31 | + NodeKey, |
| 32 | + nodeKeyToRedisOptions, |
| 33 | + NodeRole, |
| 34 | + normalizeNodeOptions, |
| 35 | + RedisOptions, |
| 36 | + weightSrvRecords, |
| 37 | +} from "./util"; |
34 | 38 | import Deque = require("denque"); |
35 | | -import { Pipeline } from ".."; |
36 | | -import applyMixin from "../utils/applyMixin"; |
37 | 39 |
|
38 | 40 | const debug = Debug("cluster"); |
39 | 41 |
|
@@ -573,7 +575,7 @@ class Cluster extends Commander { |
573 | 575 | : nodeKey; |
574 | 576 | } |
575 | 577 |
|
576 | | - sendCommand(command: Command, stream?: NetStream, node?: any): unknown { |
| 578 | + sendCommand(command: Command, stream?: WriteableStream, node?: any): unknown { |
577 | 579 | if (this.status === "wait") { |
578 | 580 | this.connect().catch(noop); |
579 | 581 | } |
|
0 commit comments