We should have a way to maintain state each time an action is run. For instance, a task might crawl a different page of a result set each time it runs, keeping track of state.pageNumber.
It would be easy to keep a small amount of state in-memory, but if the process is restarted, we'll often want to pick up where we left off.
I think loadState and saveState should be optional, asynchronous functions that can be specified by the user. They can write to a local file, a remote database, an in-memory object, or whatever else. They should be able to be specified once for the project as a whole, and overridden for individual actions (maybe inside context?)
We should have a way to maintain state each time an action is run. For instance, a task might crawl a different page of a result set each time it runs, keeping track of
state.pageNumber.It would be easy to keep a small amount of state in-memory, but if the process is restarted, we'll often want to pick up where we left off.
I think
loadStateandsaveStateshould be optional, asynchronous functions that can be specified by the user. They can write to a local file, a remote database, an in-memory object, or whatever else. They should be able to be specified once for the project as a whole, and overridden for individual actions (maybe insidecontext?)