#[lustre] rsvp or lustre_http ?

1 messages · Page 1 of 1 (latest)

shut turret
#

I mean both look similar in the goal of doing lustre effect for doing HTTP requests.
Though I’m curious what people tend to chose and the reason behind.
Also If someone could tell me which of the two was first created and what the reason for needing a second http lustre effect ?

thorny void
#

rsvp is newer, i published it beacuse it was unclear if/when lustre_http would update its gleam_json dependency around the time when that was being bumped

charred socket
#

rsvp is the canonical one and has a better API imo

#

Hayleigh too fast for me

thorny void
#

its also possible to use rsvp in server components, and is capable of sending/receiving bits

charred socket
#

You can also use a HTTP client inside an effect, if you would prefer extra control for some reason. Lustre is really good at not restricting you to a particular set of libraries

thorny void
#

aye i think that's what steerlab were doing when they were using lustre, just using gleam_fetch or maybe even ffi to fetch directly.

#

if you care about such things, rsvp also has a simulate function for testing

charred socket
#

oh that's v nice

shut turret
shut turret
thorny void
#

i'll have some effects-based improvements in the next release! 👁️

shut turret
thorny void
#

the async model is different but its entirely contained inside the effect, because the way to get the result of the request is always by dispatching a message. it doesnt matter if thats from a promise or not

shut turret
#

Oh so on the erlang side you can spawn a process, do the thing and send back the result through a message ? It’s just hard to me how you would called the dispatch function or do you just send directly from the other process a message directly for the update function ?

shut turret
thorny void
#

you could just go look at the implementation 😄 theres not that much code

shut turret
thorny void
#

i meant rsvp, but i suppose you could look at the effect pr when i open that too 😂