stream-demux 7.0.1 → 8.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/index.js +8 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -43,7 +43,7 @@ let demux = new StreamDemux();
|
|
|
43
43
|
// the same time.
|
|
44
44
|
// Note that you can optionally pass a number n to the
|
|
45
45
|
// createConsumer(n) method to force the iteration to
|
|
46
|
-
// timeout after n milliseconds of
|
|
46
|
+
// timeout after n milliseconds of inactivity.
|
|
47
47
|
let consumer = demux.stream('def').createConsumer();
|
|
48
48
|
while (true) {
|
|
49
49
|
let packet = await consumer.next();
|
package/index.js
CHANGED
|
@@ -112,6 +112,14 @@ class StreamDemux {
|
|
|
112
112
|
return this._mainStream.hasConsumer(consumerId);
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
+
getConsumerCount(streamName) {
|
|
116
|
+
return this.getConsumerStatsList(streamName).length;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
getConsumerCountAll() {
|
|
120
|
+
return this.getConsumerStatsListAll().length;
|
|
121
|
+
}
|
|
122
|
+
|
|
115
123
|
createConsumer(streamName, timeout) {
|
|
116
124
|
let mainStreamConsumer = this._mainStream.createConsumer(timeout);
|
|
117
125
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stream-demux",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.1.0",
|
|
4
4
|
"description": "A consumable stream demultiplexer.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"mocha": "^5.0.5"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"consumable-stream": "^
|
|
32
|
-
"writable-consumable-stream": "^
|
|
31
|
+
"consumable-stream": "^2.0.0",
|
|
32
|
+
"writable-consumable-stream": "^3.0.1"
|
|
33
33
|
}
|
|
34
34
|
}
|