-
Notifications
You must be signed in to change notification settings - Fork 7
Description
From my experimentation pub notifications are triggered, in some, but not all cases of an underlying file changing
For example when a PUT/PATCH/DELETE operation occurs, then a pub notification is delivered
However, if the file is changed on the file system then the watching client would be normally unaware that such a change has been made, leading to potentially inconsistent states or conflicts
One way to mitigate this would be to watch the file system and have that as an additional input to the pub / sub mechanism. In my experimentation, this works well, but the only caveat is that there are OS level configurations of the number of files that can be watched, but this can be easily raised, there is a slight memory overhead of a few bytes per file.
Another method I've used is to "touch" a file when it is updated on the OS. You can do this (hopefully!) by sending an empty PATCH to a file. However, the disadvantage of this approach is that the latency for update increases, it involves an extra moving part, can be more resource-intensive, and PATCH can be buggy.
It would be great if full realtime updates could be considered in node solid server. This is something I use on a daily basis, and it would be nice not to have to use workarounds. It's not hard to imagine a plethora of use cases for realtime updates : realtime decentralized chat, markets of changing products, media updates and slideshows, playlists and so on.