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

Managed Parameters #58

Open
fubuloubu opened this issue Mar 15, 2024 · 1 comment
Open

Managed Parameters #58

fubuloubu opened this issue Mar 15, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@fubuloubu
Copy link
Member

Overview

When designing a Silverback app, it is typically very useful to design parameterization into the logic of the app so that you can adjust this behavior. We should have a deeper integration for updating and managing these parameters, both when running live or when starting/restarting the app in a cloud environment.

Specification

We need some way for a user to describe a parameter, and add a method for it to get added to state, so that all worker tasks can see the parameter update:

@app.parameter("something", int, lower_limit=200)  # or `upper_limit=`, defaults to None
def handle_parameter(value, state):
    # NOTE: Raises if not using the same parameter name above
    state.something = value  # or, could generate a more complex handler
    # no return, but task handle will automatically return the update 

# OR, more simply:

app.add_parameter("something", int, lower_limit=...)
# basically the same as above, no ability to handle it specially

After this is done, the parameter becomes a part of both the App's environment variables (e.g. SILVERBACK_APP_something=...) as well as accepts updates triggered by the platform or management dashboard for the app (see #39)

Lastly, when accepting parameter updates, it should be possible to accept a batch of updates and process them at the same time, scheduling the tasks to take effect all before any other tasks are allowed to proceed using the new variables (all updates are atomic when batched)

Dependencies

No dependencies

@fubuloubu fubuloubu added the enhancement New feature or request label Mar 15, 2024
Copy link

linear bot commented Mar 15, 2024

@fubuloubu fubuloubu mentioned this issue May 5, 2024
3 tasks
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

1 participant