sampler
sampler copied to clipboard
[Suggestion] Variables that are shared across elements, but are run every sample time
So while making a stupidly long script for github status retrieving. i realised that i could probably have the speed increased a tonne if each of my elements were able to use the same data.
Specifically, say i have a json downloaded from github's API. and i parse any "usable" statistics from it (say issue count, pr count, stars, forks, watchers, commits, etc). normally i'd have to parse all that data on each element. what would be nice, is something similar to how you can have variables, you share it across multiple elements (same instance and etc), however it has a rate-ms
still. other elements then use this variable in the multistep-init, or other things alike.
Would be nice to have.
Currently i could technically cache the data in a temp .json file or etc, but where's the fun in that?
Ok, so we are basically talking about global-script
(s) without any visualization. Yep, that makes sense to me.
Probably we'll need init
, multistep-init
, sample
, rate-ms
options for it + something like before-startup
, telling us if we want this script to be executed before start of visualization components (e.g. global-script
results can be used in their init
)
Any other thoughts or suggestions regarding this?
That makes total sense, if you can use it as a variable (e.g. echo $script | grep "value"
) that'd be perfect. if it's the same value (only changing on the rate-ms
) then that's exactly what i'm looking for 😄
Another thought i just had. If it were possible to have other elements that are based off of a variable update after the variable does (i.e. whenever the variable updates/finishes they all run their stuff again) that'd be good, because without that you'd have to set the rate-ms of elements using your variable either at the same time (and most likely not have the updated value yet), or later (and start getting off results or etc)