Live data from Hacker News

Deno Deploy Demo: a multi-datacenter chat, client+server in 23 lines of TS

dash.deno.com

11–20 of 49 posts

Re: Deno Deploy Demo: a multi-datacenter chat, client+server in 23 lines of TS

#11
post #2

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?

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.

Re: Deno Deploy Demo: a multi-datacenter chat, client+server in 23 lines of TS

#17

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.

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

Re: Deno Deploy Demo: a multi-datacenter chat, client+server in 23 lines of TS

#20
post #4
post #2

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?

I believe the BroadcastChannel implements the server-side distributed messaging.

Neat, it’s a server-side implementation of the browser API for tab-to-tab communication.

https://deno.com/deploy/docs/runtime-broadcast-channel/

Post reply on HN