This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "isomorphic-fetch"; | |
console.log("Start ..."); | |
const numberOfRequests = 100; | |
async function main() { | |
// 1. Create x requests (as unresolved promises) | |
console.log(`Creating ${numberOfRequests} requests ...`); | |
const requests = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// VERSION 1 | |
// subscribe to all changes on the `User` table | |
const s = await prisma.user.subscribe() | |
// wait for new events to arrive | |
for await (let event of s) { | |
// log the details about an event to the terminal | |
console.log(`Something happened in the database: `) |
OlderNewer