[HN Gopher] Deno Deploy Demo: a multi-datacenter chat, client+se... ___________________________________________________________________ Deno Deploy Demo: a multi-datacenter chat, client+server in 23 lines of TS Author : ondras Score : 93 points Date : 2021-11-06 16:50 UTC (6 hours ago) (HTM) web link (dash.deno.com) (TXT) w3m dump (dash.deno.com) | 1_player wrote: | There's few things as fun as a multiplayer notepad that wasn't | intended to be an actual chat, before it's invaded by bots and | spammers. Congrats on the fella that tried to paste an ascii art | version of Pepe the Frog. | ushakov wrote: | yes, it was me all along | | https://imgur.com/a/aEHjQcp | | update: the original version was too spammy, i have changed it | so that pepe only responds to greetings or when you type "pepe" | | update 2: i have throttled pepe so it only comes back after | minute of cooldown | vnglst wrote: | Nice, I like how short and simple it is. The title seems to imply | it runs on multiple datacenters. How does it sync messages | between those? | jitl wrote: | I believe the BroadcastChannel implements the server-side | distributed messaging. | ondras wrote: | Right, as jitl suggested. The BroadcastChannel is used to allow | cross-datacenter messaging. So every script instance has its | own set of clients and forwards incoming client messages to | other script/datacenter instances. | | I suppose this is not limited to multiple datacenters, but to | multiple script instances in one datacenter as well. | mwcampbell wrote: | Has anyone written a comparison of Deno Deploy and Cloudflare | Workers yet? | babelfish wrote: | Deno: 28 datacenters Workers: 200+ datacenters | [deleted] | [deleted] | honkycat wrote: | Deno is such a nice little scripting tool. I've been using it for | devops glue and scripts lately. | | Native typescript, easy-as-pie dependency management. its great! | vnglst wrote: | What I really like about this is that you open the dependency in | a web browser and see the human readable source code. No | transpiling! https://deno.land/std/http/server.ts | ranger_danger wrote: | what is TS? | ondras wrote: | TypeScript... | ranger_danger wrote: | what, I'm just supposed to know that? | Mikeb85 wrote: | When discussing Deno, yes. | orf wrote: | I think it's not unobvious if you open the link | amadeuspagel wrote: | Here's a version that resets the input field when you hit enter: | https://dash.deno.com/playground/careful-toad-72 ___________________________________________________________________ (page generated 2021-11-06 23:00 UTC)