Hacker Newsnew | past | comments | ask | show | jobs | submit | tychi's commentslogin

Great work!

I've been dabbling with deno for a couple years now, one of the most powerful features I'm excited about is BroadcastChannel[1] support, which works with --unstable in Deno Deploy.

One of the challenges I've run into is debugging timeouts in deno deploy, so I'm curious--

1. is BroadcastChannel supported in supabase self-hosted edge functions? 2. is there more tooling available to supabase edge functions to debug than currently in deno deploy?

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

--- if curious of specifics, this is my work in progress proof of concept, exploring using pathnames for channels, to get anyone on the same url path connected across regions through sockets and broadcast channel: https://github.com/tylerchilds/kickstart/blob/869506c9dae1e1...


[Supabase engineer & author of the blog post here.]

Thanks! Good Questions

1. We haven't enabled BroadcastChannel in the Edge Runtime. Mainly because we haven't found good use cases for it within Edge Functions (it does make sense as a way to subscribe within a browser client, but not sure how it fits with async/short-lived nature of Edge Functions). Curious about how you plan to use BroadcastChannel in Edge Functions?

2. As I've mentioned in the blog post Edge Runtime allows you to tweak the duration and memory available for an Edge Function (check the examples/main/index.ts in the repo too). Personally, I use this option to debug timeouts and memory issues on Edge Functions. We also plan to introduce better ways to profile your Edge Functions in the future.


Thanks Lakshan!

I don't think my use-case is necessarily a good fit for edge functions. I am trying to achieve what Supabase realtime/multiplayer accomplishes, but generically. I participate informally with the https://braid.org IETF working group, which to over-simplify is CRDTs over HTTP with subscriptions.

I'm interested in web standards and that's what's drawn me to deno, so I'm super excited the more and more I see it being adopted. BroadcastChannel piques my interest because it is perfectly in that gray area of standardization-- it makes total sense on the client and we're on the cusp of discovering what that could look like for servers.

In deno deploy, all the instances of my service are able to be linked together by BroadcastChannel, which I'm viewing as a p2p-style architecture. Ultimately, I'm curious about how this works under the hood and if it would be possible to interoperate a BroadcastChannel between Deno Deploy, Supabase, and say a Raspberry Pi in my house.

I've gone on a bit of a tangent, but I think maybe I should get involved with the WinterCG, since now that I'm putting my thoughts to words-- seems like it fits their charter.


Yep, that sounds interesting. Feel free to share with us if you write a formal proposal. Would love to explore the options to provide better worker-to-worker communication options.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: