Pseudocode inspiration from: https://people.eecs.berkeley.edu/~kubitron/courses/cs162-F10/hand-outs/synch.html
ThreadQueue() {
var queue: Queue<Thread>;Pseudocode inspiration from: https://people.eecs.berkeley.edu/~kubitron/courses/cs162-F10/hand-outs/synch.html
ThreadQueue() {
var queue: Queue<Thread>;Run a function for every line in a file following its output. This is just a more modern version of the code found at https://stackoverflow.com/questions/11225001/reading-a-file-in-real-time-using-node-js and only uses open from fs/promises.
Just pass a callback that consumes the lines of the followed file.
import tail from './tail.js';| package extract_test | |
| import ( | |
| "regexp" | |
| "strings" | |
| "testing" | |
| ) | |
| func lines(source string) chan string { | |
| output := make(chan string) |
A simple function to handle a comunication over TCP via JSON using js generators.
Write a generator for each side of the conversation. To send or receive a message at some point just yield with one of the following functions
import { awaitMessage, sendMessage } from './mp.js'| import { dirname, resolve } from 'path' | |
| import express from 'express' | |
| import { createServer as createViteServer } from 'vite' | |
| import { fileURLToPath } from 'url' | |
| const __dirname = dirname(fileURLToPath(import.meta.url)) | |
| const ROUTES = { | |
| '/': './index.html', | |
| '/buckets/:bucket': './[bucket].html', |
#fff.