We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 95fefa8 commit b63c9c9Copy full SHA for b63c9c9
producer-consumer-send.js
@@ -31,6 +31,10 @@ function* consume() {
31
let consumer = consume();
32
let producer = produce(consumer);
33
consumer.next();
34
-while (true) {
+
35
+function step() {
36
producer.next();
37
+ setImmediate(step);
38
}
39
40
+step();
producer-consumer.js
@@ -26,7 +26,21 @@ function* consume() {
26
27
28
29
+function* anotherTask() {
30
+ while (true) {
+ yield* sleep(1000);
+ console.log('Hello!\n');
+ }
+}
+let task = anotherTask();
41
+ task.next();
42
43
44
45
46
0 commit comments