You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently I'm using a callback when a batch is created to do a bunch of initialization stuff, in an async way:
Empirica.on("batch",async(ctx,{ batch })=>{// fetch data// check that I have all the required resources// check configs// validate the treatment// etc.}
the problem (and its a small one) is that I can start the batch (and run all the batch start callbacks) before this has finished. Then, if the batch start callback is expecting the batch creation callback to have finished its initialization stuff, it either can check for initialization and intentionally go to a "failed" state batch.set("status", "failed") or (more likely, as I assumed the initialization had finished) behave unpredictably.
Describe the solution you'd like
Possibly create an additional state a batch can be in that is created by not ready to start yet. (Initializing?) that gets set when the batch creation callback resolves.
Describe alternatives you've considered
Currently I manually check that initialization has finished in the batch start callback, and if it has not, fail the batch.
Is there an existing issue for this?
Is your feature request related to a problem?
Currently I'm using a callback when a batch is created to do a bunch of initialization stuff, in an async way:
the problem (and its a small one) is that I can start the batch (and run all the batch start callbacks) before this has finished. Then, if the batch start callback is expecting the batch creation callback to have finished its initialization stuff, it either can check for initialization and intentionally go to a "failed" state
batch.set("status", "failed")
or (more likely, as I assumed the initialization had finished) behave unpredictably.Describe the solution you'd like
Possibly create an additional state a batch can be in that is created by not ready to start yet. (Initializing?) that gets set when the batch creation callback resolves.
Describe alternatives you've considered
Currently I manually check that initialization has finished in the batch start callback, and if it has not, fail the batch.
Teachability, Documentation, Adoption, Migration Strategy
Should be transparent to most users.
Code of Conduct
The text was updated successfully, but these errors were encountered: