Skip to content

Instantly share code, notes, and snippets.

View nikolasburk's full-sized avatar
😑

Nikolas nikolasburk

😑
View GitHub Profile
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 = [];
// 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: `)