-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Conversation
We have implemented something very similar https://github.com/laminar-protocol/open-runtime-module-library/blob/master/schedule-update/src/lib.rs |
Very similar indeed. Though it seems yours is more specialised towards working with extrinsics allowing e.g. signed origins to delay a dispatch until later, whereas this is purely for internal APIs. |
Co-Authored-By: Marcio Diaz <marcio.diaz@gmail.com>
Co-Authored-By: Marcio Diaz <marcio.diaz@gmail.com>
Co-Authored-By: Marcio Diaz <marcio.diaz@gmail.com>
Co-Authored-By: Marcio Diaz <marcio.diaz@gmail.com>
Co-Authored-By: Marcio Diaz <marcio.diaz@gmail.com>
frame/scheduler/src/lib.rs
Outdated
/// Cancel a periodic dispatch. If called during its dispatch, it will not be dispatched | ||
/// any further. If called between dispatches, the next dispatch will happen as scheduled but | ||
/// then it will cease. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Cancel a periodic dispatch. If called during its dispatch, it will not be dispatched | |
/// any further. If called between dispatches, the next dispatch will happen as scheduled but | |
/// then it will cease. | |
/// Cancel a periodic dispatch. | |
/// | |
/// If called during its dispatch, it will not be dispatched | |
/// any further. If called between dispatches, the next dispatch will happen as scheduled but | |
/// then it will cease. |
frame/scheduler/src/lib.rs
Outdated
1 => { | ||
Self::schedule(when, priority, call); | ||
0 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | |
}, |
frame/scheduler/src/lib.rs
Outdated
let s = Scheduled { priority, call, maybe_periodic: Some(index) }; | ||
Agenda::<T>::append_or_insert(when, &[s][..]); | ||
index | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | |
}, |
but I am not sure if there will be any difference besides aestetic |
type Call: Parameter + Dispatchable<Origin=<Self as Trait>::Origin> + GetDispatchInfo; | ||
|
||
/// The maximum weight that may be scheduled per block for any dispatchables of less priority | ||
/// than 255. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// than 255. | |
/// than `HARD_DEADLINE`. |
Superseded by #5412 |
Scheduler to allow for dispatchables to be called in the future without being concerned about using
on_initialize
.