collectOnlineNodes() {
		// Get the current node list so that we can check the disconnected nodes.
		const prevNodes = this.registry.nodes
			.list({ onlyAvailable: true, withServices: false })
			.map(node => node.id)
			.filter(nodeID => nodeID !== this.broker.nodeID);

		// Collect the online node keys.
		return new this.Promise((resolve, reject) => {
			const stream = this.client.scanStream({
				match: `${this.PREFIX}-BEAT:*`,
				count: this.opts.scanLength
			});

			let scannedKeys = [];

			stream.on("data", keys => {
				if (!keys || !keys.length) return;
				scannedKeys = scannedKeys.concat(keys);
			});

			stream.on("error", err => reject(err));
			stream.on("end", () => {
				if (scannedKeys.length == 0) return resolve();

				this.Promise.resolve()
					.then(() => {
						if (this.opts.fullCheck && ++this.idx % this.opts.fullCheck == 0) {
							// Full check
							//this.logger.debug("Full check", this.idx);
							this.idx = 0;

							return this.client.mgetBuffer(...scannedKeys).then(packets =>
								packets.map((raw, i) => {
									try {
										const p = scannedKeys[i]
											.substring(`${this.PREFIX}-BEAT:`.length)
											.split("|");
										return {
											sender: p[0],
											instanceID: p[1],
											seq: Number(p[2]),
											...this.serializer.deserialize(raw, P.PACKET_INFO)
										};
									} catch (err) {
										this.logger.warn(
											"Unable to parse HEARTBEAT packet",
											err,
											raw
										);
									}
								})
							);
						} else {
							//this.logger.debug("Lazy check", this.idx);
							// Lazy check
							return scannedKeys.map(key => {
								const p = key.substring(`${this.PREFIX}-BEAT:`.length).split("|");
								return {
									sender: p[0],
									instanceID: p[1],
									seq: Number(p[2])
								};
							});
						}
					})
					.then(packets => {
						packets.map(packet => {
							if (packet.sender == this.broker.nodeID) return;

							removeFromArray(prevNodes, packet.sender);
							this.heartbeatReceived(packet.sender, packet);
						});
					})
					.then(() => resolve());
			});
		}).then(() => {
			if (prevNodes.length > 0) {
				// Disconnected nodes
				prevNodes.forEach(nodeID => {
					this.logger.info(
						`The node '${nodeID}' is not available. Removing from registry...`
					);
					this.remoteNodeDisconnected(nodeID, true);
				});
			}
		});
	}
Collect online nodes from Redis server.