RoundRobinAgentTaskDistributor

Trait RoundRobinAgentTaskDistributor 

Source
pub trait RoundRobinAgentTaskDistributor<'a> {
    // Required methods
    fn get_agent_tasks(
        &self,
        deps: &Deps<'_>,
        env: &Env,
        agent_id: Addr,
        slot_items: (Option<u64>, Option<u64>),
    ) -> Result<AgentTaskResponse, ContractError>;
    fn on_task_completed(
        &self,
        storage: &'a mut dyn Storage,
        _env: &Env,
        agent_id: &Addr,
        slot_type: SlotType,
    ) -> Result<(), ContractError>;
}

Required Methods§

Source

fn get_agent_tasks( &self, deps: &Deps<'_>, env: &Env, agent_id: Addr, slot_items: (Option<u64>, Option<u64>), ) -> Result<AgentTaskResponse, ContractError>

.Gets agent tasks count for block/cron slots # Errors This function will return an error if agent does not exists

Source

fn on_task_completed( &self, storage: &'a mut dyn Storage, _env: &Env, agent_id: &Addr, slot_type: SlotType, ) -> Result<(), ContractError>

Updates agent stats when agent completed task on specified slot

Implementors§

Source§

impl<'a> RoundRobinAgentTaskDistributor<'a> for AgentTaskDistributor

Note that we ran into problems with clippy here See https://github.com/CronCats/cw-croncat/pull/415