summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGianni Ceccarelli <gceccarelli@veritone.com>2023-10-05 16:03:44 +0100
committerGianni Ceccarelli <gceccarelli@veritone.com>2023-10-05 16:03:44 +0100
commitbf7d740cdd0a375f1950c38a2f5ccc66375b6030 (patch)
tree72a7295171ca29f42475ac729739d693e74ec791
parentworks enough (diff)
downloadpuppa-master.tar.gz
puppa-master.tar.bz2
puppa-master.zip
allow watching multiple streams at a timeHEADmaster
-rw-r--r--index.js15
1 files changed, 11 insertions, 4 deletions
diff --git a/index.js b/index.js
index 88930aa..8350c9c 100644
--- a/index.js
+++ b/index.js
@@ -72,10 +72,7 @@ function delayP(delay) {
});
}
-(async () => {
- const channel = 'yogscast'; // a random channel
- const runForMs = 3600 * 1000; // 1 hour
-
+async function watch(channel,runForMs=3600 * 1000 /* 1 hour */) {
const x = await goThere(channel);
const started = Date.now();
@@ -86,4 +83,14 @@ function delayP(delay) {
}
await x.browser.close();
+}
+
+const channels = [ 'yogscast', 'yogscast' ];
+
+(async () => {
+ const watchers = channels.map(
+ (c) => watch(c)
+ );
+
+ await Promise.all(watchers);
})();