livefir / fir

Build reactive html apps in Go

Home Page:https://livefir.fly.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pub sub with NATS

gedw99 opened this issue · comments

commented

I use nats with htmx.

fir could too .

then all endpoints are virtualised and so are the handlers.

commented

nats can be embedded also, so can make it easier for deployment

https://github.com/livefir/fir/blob/main/pubsub/pubsub.go#L37 looks like we can add nats since you have the adpater pattern

Kine uses nats: https://github.com/k3s-io/kine

for nats: https://github.com/k3s-io/kine/blob/master/examples/nats.md

DO these semantics line up with what you need ?

  • Optimized get, put, create, and update commands
    • create expects the key to not exist (or was previously deleted)
    • update requires a version number used for OCC against the key
  • Historical and versioned values per key
  • Subscription of changes for the entire KV store a subset of keys

As you can see we can run NATS embedded OR call it externally as a cluster or not.

Hi @gedw99 . Generally looks like an interesting idea but right now focused on getting the event -> template change api right. Next up is #42

Unsure how NATS fits into Fir. I ran some benchmarks and the combination of Redis + Websocket is good enough for now. Will revisit this when scale becomes a problem.