Fork me on GitHub
#hyperfiddle
<
2023-12-06
>
joshcho02:12:06

How would streaming videos* work in electric? Websockets are used a lot for videos iiuc

Cora (she/her)03:12:12

websockets in videos?? I've never heard of that

joshcho03:12:43

What’s usually used?

joshcho03:12:48

I meant streaming actually

joshcho03:12:03

Like twitch

Cora (she/her)03:12:20

HLS and DASH are the big players

❤️ 1
joshcho03:12:41

I am talking to some mux ppl

joshcho03:12:52

Interesting

Cora (she/her)03:12:10

I worked at Zencoder which is where the people from Mux came from

joshcho03:12:21

Very cool!

Cora (she/her)03:12:32

yeah, they're nice folks.

joshcho03:12:47

So idk if u heard but twitch is leaving korea

Cora (she/her)03:12:59

I didn't hear, no

joshcho03:12:12

So I am thinking about a metaverse-oriented streaming platform to fill that gap

joshcho03:12:25

For like 50 streamers I know well initially

Cora (she/her)03:12:15

does anyone use metaverse?

Cora (she/her)03:12:26

and why is twitch leaving korea?

joshcho03:12:59

There’s like 200k viewers at the very least

joshcho03:12:08

Twitch is leaving bc of regulation costs

Cora (she/her)03:12:52

well, best of luck with that. the Mux folks should either know how to do it or know how to figure it out

joshcho03:12:46

I’m talking to paul klein rn

joshcho03:12:55

Who sold streamclub to mux

Cora (she/her)03:12:42

I haven't really followed Mux much, didn't know they did acquisitions, only heard about layoffs a few times

danbunea09:12:24

Newbie question no #2. I want to render a list of entities (Entity-item) which i read from the server (pull-table). When I edit, add or delete one I change the data on the server, but I'd like to only load the changes not the entire list so I don't want to reinstantiate the component. What are my options?

(e/defn Entity-list []
  (let [!state (atom {})
        state (e/watch !state)]
    (e/server
     (e/for-by :db/id [item (pull-table )]
               (let [id (:db/id item)
                     name (:a.o.r.chat.pl/name item)]
                 (e/client (Entity-item. id name)))))))
I had the impression that swapping the client !state atom would be enough, but it's clever and doesn't do the server call again, so I need another approach.

henrik10:12:19

Do I read your code correctly, that the for-by doesn’t depend on the state. Or is it an input to pull-table?

danbunea10:12:59

I was just thinking to make it depend on it, then it will be retriggered

henrik10:12:15

Ah, OK. Yes, only things that depend on state will be refreshed.

danbunea10:12:41

this is very neat 🙂

danbunea10:12:03

thank you, I am making it work now

👍 1
danbunea10:12:17

working, of course, as it all makes sense 🙂

danbunea10:12:23

so, maybe for others:

(e/defn Entity-list []
  (let [!state (atom {:ver 0})
        state (e/watch !state)
        ver (:ver state)]
    (e/server
     (e/for-by :db/id [item (pull-table ver)]
               (let [id (:db/id item)
                     name (: item)]
                 (e/client (Entity-item. id name)))))))
when ver changes, the pull-table will be rerun and only the changes sent to the client and rendered.

avocade15:12:48

After having used the ic experimental branch as the base for some time, it feels pretty much as snappy as when working with uix before. The time to recompile went down from 40s to 4s. So an order of magnitude improvement, not something to take for granted. Well done 👍

🎉 6