[−][src]Trait frame_support::traits::schedule::Anon
A type that can be used as a scheduler.
Associated Types
type Address: Codec + Clone + Eq + EncodeLike + Debug
An address which can be used for removing a scheduled task.
Required methods
fn schedule(
when: BlockNumber,
maybe_periodic: Option<Period<BlockNumber>>,
priority: Priority,
call: Call
) -> Result<Self::Address, DispatchError>
when: BlockNumber,
maybe_periodic: Option<Period<BlockNumber>>,
priority: Priority,
call: Call
) -> Result<Self::Address, DispatchError>
Schedule a one-off dispatch to happen at the beginning of some block in the future.
This is not named.
Infallible.
fn cancel(address: Self::Address) -> Result<(), ()>
Cancel a scheduled task. If periodic, then it will cancel all further instances of that, also.
Will return an error if the address
is invalid.
NOTE: This guaranteed to work only before the point that it is due to be executed. If it ends up being delayed beyond the point of execution, then it cannot be cancelled.
NOTE2: This will not work to cancel periodic tasks after their initial execution. For
that, you must name the task explicitly using the Named
trait.