#Fastest way to communicate between webview and Rust backend

20 messages · Page 1 of 1 (latest)

stable pine
#

Hey does anyone know what the fastest way for a webview window and my Rust backend to communicate is?

Commands?
Events?
Channels?

Are commands and channels not the same? Both are just tauri's http-based IPC in disguise no??

Why doesn't tauri use webview bindings?

valid oyster
#

probably channels i think

#

cause they don't do json serialization

stable pine
#

@valid oyster thanks -- do you know if there's any performance drawback to having MANY channels?

#

i have many lists of... things. and i'm wondering whether to make one channel per list, or one per thing

valid oyster
#

as per Tauri docs

it might not be suitable to sending a large amount of data.
looking through the issues on github, i don't seem to find any issues related to having many channels

stable pine
#

oh each packet would be super small, it's just lots of them

#

anyways -- thank you!!

valid oyster
#

another option could be to have custom URI protocol

valid oyster
stable pine
#

oh wait what, actually it seems like channels are using webview.eval too?

valid oyster
stable pine
#

maybe there's any way I can webview.eval myself

valid oyster
stable pine
#

but i wonder why they then say that channels are faster than events?

#

they say events eval, and channels are faster

valid oyster
#

serialization

stable pine
#

seems like that's the only difference