Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion] Variables that are shared across elements, but are run every sample time #38

Open
Asherslab opened this issue Aug 9, 2019 · 3 comments
Labels
enhancement New feature or request

Comments

@Asherslab
Copy link

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?

@sqshq
Copy link
Owner

sqshq commented Aug 9, 2019

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?

@sqshq sqshq added the enhancement New feature or request label Aug 9, 2019
@Asherslab
Copy link
Author

Asherslab commented Aug 10, 2019

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 😄

@Asherslab
Copy link
Author

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants