Re:Deno Deploy Demo: a multi-datacenter chat, client+server ...
by vnglst on Saturday November 06, 2021 @02:31PM
(#29132629)
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?
[ Parent
| on HN ]
Re:Deno Deploy Demo: a multi-datacenter chat, client+server ...
by schemescape on Saturday November 06, 2021 @07:55PM
(#29135005)
I was also wondering how this worked, and the following Deno Deploy documentation explains it: https://deno.com/deploy/docs/runtime-broadcast-channel/#broa...
Re:Deno Deploy Demo: a multi-datacenter chat, client+server ...
by jitl on Saturday November 06, 2021 @02:56PM
(#29132842)
I believe the BroadcastChannel implements the server-side distributed messaging.
Re:Deno Deploy Demo: a multi-datacenter chat, client+server ...
by paulgb on Saturday November 06, 2021 @07:33PM
(#29134881)
Neat, itβs a server-side implementation of the browser API for tab-to-tab communication.
Re:Deno Deploy Demo: a multi-datacenter chat, client+server ...
by rhizome on Saturday November 06, 2021 @10:43PM
(#29136065)
class BroadcastChannel
return `system('ircd')`
end
Only three lines! :D
Re:Deno Deploy Demo: a multi-datacenter chat, client+server ...
by ondras on Saturday November 06, 2021 @04:26PM
(#29133534)
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.