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§
Sourcefn get_agent_tasks(
&self,
deps: &Deps<'_>,
env: &Env,
agent_id: Addr,
slot_items: (Option<u64>, Option<u64>),
) -> Result<AgentTaskResponse, ContractError>
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
Sourcefn on_task_completed(
&self,
storage: &'a mut dyn Storage,
_env: &Env,
agent_id: &Addr,
slot_type: SlotType,
) -> Result<(), ContractError>
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§
impl<'a> RoundRobinAgentTaskDistributor<'a> for AgentTaskDistributor
Note that we ran into problems with clippy here See https://github.com/CronCats/cw-croncat/pull/415