-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
On-air alert functionality (w JBot! sorta...) #41
Comments
I got a basic deno serverless/edge function working that stores a JSON object that looks like this in redis:
then makes it accessible from a GET request (e.g. when the page loads) and allows POST/DELETE requests with a JWT signed with an RSA key pair to update that object I'm unsure if it's a good idea to set up a system to notify clients, people viewing the website or possibly a background service worker, about any changes realtime instead of the website checking whenever it's loaded. Then clients could be notified right away that JB went live, but it's a complex system to set up and would require a server to handle the subscriptions. (because the clients would be behind NAT and a callback URL wouldn't work) I don't think regular HTTP polling is a good idea because of bandwidth costing money. |
Serverless function gist: https://gist.github.com/reesericci/2875f2049993c0fea7b67abf1eb1984a |
@StefanS-O is there any pipeline for deploying a serverless function? (i.e. vercel, netlify, cloudflare workers, deno, etc) |
I know I'm not Stefan, but from my observation of the infrastructure there isn't. If you just do an nslookup on the website domain: $ nslookup jupiterbroadcasting.net 8.8.8.8
Server: 8.8.8.8
Address: 8.8.8.8#53
Non-authoritative answer:
Name: jupiterbroadcasting.net
Address: 142.132.186.250 And a If they use more of cloudflare (reasons mentioned here), you should be able to use cloudflare workers. |
Also, I know I haven't really commented on this issue before, and am definitely not very familiar with redis, but if you're looking for a KV store is there a reason for not using a hosted service like this: https://www.cloudflare.com/products/workers-kv/ I've never used it before, but just thinking of ways to lighten the amount of services that JB'll have to run initially to get the website up and running. I'd imagine if they want to host a redis instance later on (since self-hosting is something JB does) that'd be doable, but just to initially launch without an extra 2-3 services (search + s3 endpoint where some other services talked about). |
CF KV is an excellent solution, I just didn't want to use it if JB wasn't going to utilize CF workers for deploying this. |
I also built it on top of the Deno runtime which is not supported by CF, only themselves (Deno Deploy) and Netlify from what I remember. |
Ya, IIRC CF works run their own version of a node runtime, right? (Only heard about it on podcasts) |
Deno isn't node so it wouldn't work |
for realtime updates Cloudflare's Pub/Sub: https://developers.cloudflare.com/pub-sub/ could possibly work instead of self-hosting a pub/sub solution. |
As it turns out, redis has a builtin Pub/Sub function: https://redis.io/docs/manual/pubsub/ |
Ya, I was mainly asking if you knew the runtime that they use, not trying to say deno is node 🙃 |
Cool! So redis could be used for local dev and Cloudflare could be used for prod? I wouldn't start working on modifing it (unless you want to) until you get a JB person's (or others via proxy (@StefanS-O or someone similar) ) opinion which solution they'd like more. (Self-hosting redis, cloudflare KV or Pub/Sub, etc...) It's honestly up to them for whatever is easiest to implement/maintain + what's needed. I was honestly just asking, because I was curious 😅 |
I will start looking into this after launch, this is not a milestone 1 issue and also needs decissions from @ChrisLAS where this should be hosted. |
feature completed by #378 |
@reesericci:
The text was updated successfully, but these errors were encountered: