Server-Sent Events in Remix (feat. Moishi Netzer)

  Рет қаралды 5,808

Remix

Remix

Күн бұрын

Пікірлер: 24
@こんにゃく-n7t
@こんにゃく-n7t 2 ай бұрын
This is exactly what I've searched for. Using Remix's fetcher.submit, emitting event handler, and listening to updated data with hooks are the elegant solution when making AI Chatbot streaming while using server actions.
@alfonsocartes
@alfonsocartes Жыл бұрын
What a star Moishi! Great video guys! Brooks keeping it interesting always!
@moishinetzer
@moishinetzer Жыл бұрын
Appreciate that Alfonso! Thanks for the support! Hope you're keeping well
@MrKeliv
@MrKeliv Жыл бұрын
Wonderful feature of Remix. I love Remix
@burakcanavc
@burakcanavc Жыл бұрын
I'm surprised with every new video. You are incredible.
@sihoonkim1502
@sihoonkim1502 Жыл бұрын
I wonder if the loader runs twice, for the client that does the action. I think the loader would run once when action completes and one more time when it receives the event. For a simple optimization, maybe we omit to send event if that client caused the action. I think u could do this by including some sort of session info (userId) in the emitter part in action. Then in the stream route, u can compare that userId with the userId u get from the request. If they are the same, then dont send it to the client!
@aniforprez
@aniforprez Жыл бұрын
damn this was fantastic! loved the video
@mammothoff
@mammothoff Жыл бұрын
This is crazy 🔥
@benediktaslaboga3510
@benediktaslaboga3510 Жыл бұрын
Keep good work guys 🎉
@jodwbe
@jodwbe 8 ай бұрын
Im just loving this framework more and more. Been using it for my own projects. 💪🏽
@busbritt
@busbritt Жыл бұрын
Great job guys 👍
@TEMISsX
@TEMISsX Жыл бұрын
It's super cool ! So easy to make it works with Remix ! I'm going to use this at work 💪
@MonoMario89
@MonoMario89 Жыл бұрын
great video! very informative. I was trying to set up this very same flow but I couldn't. Now I know how to do it and removing the need of a WebSocket. Nice
@gogdarag
@gogdarag Жыл бұрын
Great video. Remix is ❤
@jpkontreras
@jpkontreras Жыл бұрын
gold content remix is the future imo
@Ewooy
@Ewooy Жыл бұрын
Great talk, thank you. But I am curious how would you tackle horizontal scalability (where 2 clients are potentially connected to 2 different servers). Also I'm not familiar with serverless environments, will there be the same issues?
@moishinetzer
@moishinetzer Жыл бұрын
Good questions! To sync multiple servers/serverless you would need some kind of common denominator between them. In practice this means hooking your project up to a centralised Redis Pub/Sub or my personal favourite a kafka instance. When events are triggered intead of emitting to the emitter, you enqueue a message or publish to an "events" topic. After that, you create a subscriber/consumer that when it receives a message on the "events" topic it emits to the EventEmitter, this works because now every client connected to every server receives the message from that servers' emitter. It looks something like this: Server 1 Server 2 ... Server N | EventEmitter | EventEmitter | EventEmitter | | | +---------+ +-------+-------+ +----------------------------+ | | | | v v v v +--------------------------------------------------------------+ | Central Message Broker | | (Redis Pub/Sub, Kafka, etc.) | | - Publishes to "events" topic | | - Receives messages from all servers | +--------------------------------------------------------------+ | ^ | | +--+ Emit/Enqueue Messages
@yarapolana
@yarapolana Жыл бұрын
Would be great to have short video on polyfills for edge environments so we can use libs like cloudinary/some ai libs on edge
@ashneilroy
@ashneilroy Жыл бұрын
Amazing!
@Greybph
@Greybph Жыл бұрын
That is awesome
@theldentity
@theldentity Жыл бұрын
this is pretty fucking cool! 😻
@sihoonkim1502
@sihoonkim1502 Жыл бұрын
Actually although API wise SSE is not bidirectional, networkwise couldnt we say SSE is "bidirectional"? cuz action, loader and SSE all share the same http connection with http2,3 So not only is SSE simple, handles reconnection out of the box, but also no added network cost!
My scorpion was taken away from me 😢
00:55
TyphoonFast 5
Рет қаралды 2,7 МЛН
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
Searching IndexedDB in Remix
18:22
Remix
Рет қаралды 8 М.
Remixing Toast Notifications (feat. Andre Landgraf)
1:17:40
Prefetching Links in Remix
10:29
Remix
Рет қаралды 7 М.
The SQLite Rewrite In Rust
22:15
ThePrimeTime
Рет қаралды 157 М.
Introducing Clay - High Performance UI Layout in C
35:19
Nic Barker
Рет қаралды 89 М.
Is Virtual DOM Bad? Answering Listener Questions
57:10
Syntax
Рет қаралды 2,6 М.
Homegrown Remix Middleware (feat. Kiliman)
51:05
Remix
Рет қаралды 3,6 М.
Roadmap Planning #13
52:56
Remix
Рет қаралды 3,9 М.
Caching Data in Memory with Remix Client Loaders
9:15
Remix
Рет қаралды 10 М.
Server-Sent Events Crash Course
29:48
Hussein Nasser
Рет қаралды 98 М.