burr icon indicating copy to clipboard operation
burr copied to clipboard

Add ability to reset an application

Open skrawcz opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe. Instead of creating a new application every time, what if we could reset some "state" and "application-y" things about it?

Describe the solution you'd like Things that could be helpful:

  • .set_state(...)
  • .set_identifiers(...)
  • .set_next_action(action_name)

Describe alternatives you've considered You just reinstantiate the graph each time.

Additional context This is mainly an edge case around stateless web-services. Do you create new, or reset the state?

skrawcz avatar Aug 21 '24 06:08 skrawcz

Is your feature request related to a problem? Please describe. Instead of creating a new application every time, what if we could reset some "state" and "application-y" things about it?

Describe the solution you'd like Things that could be helpful:

  • .set_state(...)
  • .set_identifiers(...)
  • .set_next_action(action_name)

Describe alternatives you've considered You just reinstantiate the graph each time.

Additional context This is mainly an edge case around stateless web-services. Do you create new, or reset the state?

.set_state is already supported. .set_next_action could be interesting, but why would we do it out of band? .set_identifiers is iffy -- we shouldn't have the same application object have two separate set of IDs.

I think we want to create new, and make it easier for that to happen.

app = ...
new_app = app.fork(reinitialize=True)

There is almost no case in which the object management here is going to be problematic (if you have billions of them you'll probably have the scale to back it up).

elijahbenizzy avatar Aug 21 '24 16:08 elijahbenizzy