File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ async function streamConsumer() {
16
16
commandOptions ( {
17
17
isolated : true
18
18
} ) , [
19
- // XREAD can read from multiple streams, starting at a
19
+ // XREAD can read from multiple streams, starting at a
20
20
// different ID for each...
21
21
{
22
22
key : 'mystream' ,
@@ -33,7 +33,7 @@ async function streamConsumer() {
33
33
// Response is an array of streams, each containing an array of
34
34
// entries:
35
35
// [
36
- // {
36
+ // {
37
37
// "name": "mystream",
38
38
// "messages": [
39
39
// {
@@ -49,17 +49,16 @@ async function streamConsumer() {
49
49
50
50
// Get the ID of the first (only) entry returned.
51
51
currentId = response [ 0 ] . messages [ 0 ] . id ;
52
- console . log ( currentId ) ;
52
+ console . log ( currentId ) ;
53
53
} else {
54
- // Response is null, we have read everything that is
54
+ // Response is null, we have read everything that is
55
55
// in the stream right now...
56
56
console . log ( 'No new stream entries.' ) ;
57
57
}
58
+ } catch ( err ) {
59
+ console . error ( err ) ;
58
60
}
59
- } catch ( err ) {
60
- console . error ( err ) ;
61
61
}
62
62
}
63
63
64
64
streamConsumer ( ) ;
65
-
You can’t perform that action at this time.
0 commit comments