[][src]Trait frame_support::traits::schedule::Named

pub trait Named<BlockNumber, Call> {
    type Address: Codec + Clone + Eq + EncodeLike + Debug;
    fn schedule_named(
        id: impl Encode,
        when: BlockNumber,
        maybe_periodic: Option<Period<BlockNumber>>,
        priority: Priority,
        call: Call
    ) -> Result<Self::Address, ()>;
fn cancel_named(id: impl Encode) -> Result<(), ()>; }

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.

Loading content...

Required methods

fn schedule_named(
    id: impl Encode,
    when: BlockNumber,
    maybe_periodic: Option<Period<BlockNumber>>,
    priority: Priority,
    call: Call
) -> Result<Self::Address, ()>

Schedule a one-off dispatch to happen at the beginning of some block in the future.

  • id: The identity of the task. This must be unique and will return an error if not.

fn cancel_named(id: impl Encode) -> Result<(), ()>

Cancel a scheduled, named task. If periodic, then it will cancel all further instances of that, also.

Will return an error if the id 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.

Loading content...

Implementors

Loading content...