Connection.(constructor)
构造 Connection 类的新实例
🌐 Constructs a new instance of the Connection class
语法
🌐 Signature
class Connection {
constructor(
url: string,
transport: ConnectionTransport,
delay?: number,
timeout?: number,
rawErrors?: boolean,
idGenerator?: () => number,
);
}
参数
🌐 Parameters
范围 🌐 Parameter | 类型 🌐 Type | 描述 🌐 Description |
|---|---|---|
url | string | |
transport | ||
delay | number | (可选) 🌐 (Optional) |
timeout | number | (可选) 🌐 (Optional) |
rawErrors | boolean | (可选) 🌐 (Optional) |
idGenerator | () => number | (可选) 🌐 (Optional) |