The Elemental Chat app uses it heavily; @ddd-mtl’s SnapMail uses it (???); pretty much all chat-like apps rely on this thing called Signals to be able to propagate incoming messages all the way to the UI. And looks like Signals have been a part of Holochain since even before RSM! Yet, I couldn’t find any extensive explanation of how they work (neither on docs.rs, nor on Holochain blog, nor on this forum, nor on Wasm Workspace’s test utils, nor on @guillemcordoba’s Holochain Gym, nor anywhere else).
Basically, here’s what I’ve understood thus far:
You expose one of your extern functions to other remote users via capability grants; thus, I, for example, when messaging you, can call that remote function on your node that will throw a signal at you (if you happen to be online, of course), i.e., it will somehow magically ring a bell and make your UI update its messages list to poll that new message too. But how does this magic happen? Does the UI open some special WebSocket connection with the conductor just for incoming signals? How do Signals save the UI from having to repeatedly call some
fetch_new_messages() extern function? Also, is the implementation of Signals hiding some HDK-callbacks under the hood that I’m unaware of? I’m clueless! PLEASE HELP!!!
A step-by-step explanation of how Signals get propagated all the way to the UI would be very helpful, indeed…
[cc (besides the above two): @pauldaoust, the master explainer]