Skip to main content

run_next

Function run_next 

Source
pub(crate) async fn run_next<A, C, Fut>(
    state: &AppState,
    settings: &Settings,
    now_ms: i64,
    account: A,
    call: C,
) -> Result<Option<(String, End)>, String>
where A: FnOnce(&str) -> DreamAccount, C: FnOnce(Call, String) -> Fut, Fut: Future<Output = Result<ModelAnswer, CallFailed>>,
Expand description

Run the one queued dream the schedule allows now, if any: returns its id and how it ended. account says which account an agent’s pass runs on; call makes the model call for the pass. call is not called when a rule holds the pass back, nor when the agent’s account cannot be resolved: that pass is held with the reason, and no other account is tried.