You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.
Could it be possible for DatArchives to send "signals" to one another.
Implementation Suggestion:
An experimental API that behaves similar to creating a JS custom event, e.g.:
// Target of the datSignalvarotherArchive=newDatArchive(otherArchiveLocation);// Create a Custom datSignalvarupdateSignal=experimental.datSignal("Update");// Dispatch the datSignalupdateSignal.dispatchTo(otherArchive);
And on the front-end side this doesn't event need to be implemented, but the JS event system could be used instead.
Say, in that otherArchive the updateSignal is received by an EventListener updateEvent attached to document, and when the archive receives that signal it just fires off that updateEvent.
The text was updated successfully, but these errors were encountered:
The former. The signal would be dispatched to the target archive which would receive it and fire it off as a JS event inside of its own html page.
Also I can see one problem in this and that is that archives aren't available all the time, so there might not be an archive to receive the signal. A solution might be to implement/reuse a watcher (just like the one used for the Beaker Watchlist) and dispatch the signal when the archive becomes available.
@mikister yeah that's a solid idea, basically using Dats as identities. We've got some tools for messaging in the works with beakerbrowser/beaker-core#6 so we might be able to accomplish that kind of stuff.
Could it be possible for DatArchives to send "signals" to one another.
Implementation Suggestion:
An experimental API that behaves similar to creating a JS custom event, e.g.:
And on the front-end side this doesn't event need to be implemented, but the JS event system could be used instead.
Say, in that
otherArchive
theupdateSignal
is received by an EventListenerupdateEvent
attached to document, and when the archive receives that signal it just fires off thatupdateEvent
.The text was updated successfully, but these errors were encountered: