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
I want one widget to run two different commands with different refresh intervals. (Perhaps one is expensive and should be run less often.)
I want two different widgets to use the output from the same command. (Again, perhaps the command is expensive and shouldn't be run twice to render both widgets.)
The easiest way to implement these would be to allow widgets to access the command output (or the rendered output) of other widgets. This way, you could have a widget which is not meant to display, whose sole purpose is to provide data for one or more other widgets. Presumably a widget would update, not just on its own refresh schedule, but every time any widget it refers to updates.
The text was updated successfully, but these errors were encountered:
When I've needed that, I made a widget with display:none that runs once every, say, 10 minutes.
This widget's command writes the output of the command to the disk, with eg. command: curl https://google.com > shared_file, and then the other two widgets can just read it: cat shared_file. The two "client" widgets (or however many) can run at a much more frequent interval, because they're less expensive; mine are visually simple, so I just have them run every ten seconds.
expensive.widget:
command:"curl https://google.com > output_file"# use stdout redirection to save to a filerefreshFrequency:'10m'style:'display: none'render:''
display_1.widget:
command:"cat output_file"refreshFrequency:'10s'# then actually render it
display_2.widget:
command:"cat output_file"refreshFrequency:'10s'# now render it differently
Hopefully that made some sort of sense and/or actually works?
interesting 🤔
I also wonder if the data source/command runner could be abstracted out of the widget so that several widgets can listen to the same data source
There are two use cases I'm considering:
I want one widget to run two different commands with different refresh intervals. (Perhaps one is expensive and should be run less often.)
I want two different widgets to use the output from the same command. (Again, perhaps the command is expensive and shouldn't be run twice to render both widgets.)
The easiest way to implement these would be to allow widgets to access the command output (or the rendered output) of other widgets. This way, you could have a widget which is not meant to display, whose sole purpose is to provide data for one or more other widgets. Presumably a widget would update, not just on its own refresh schedule, but every time any widget it refers to updates.
The text was updated successfully, but these errors were encountered: