Struct delay_timer::timer::task::TaskBuilder [−][src]
pub struct TaskBuilder<'a> { /* fields omitted */ }
Expand description
Cycle plan task builder.
Implementations
👎 Deprecated
Set task Frequency.
This api will be deprecated in the future, please use set_frequency_once_*
| set_frequency_count_down_*
| set_frequency_repeated_*
etc.
pub fn set_frequency_by_candy<T: Into<CandyCronStr>>(
&mut self,
frequency: CandyFrequency<T>
) -> &mut Self
👎 Deprecated
pub fn set_frequency_by_candy<T: Into<CandyCronStr>>(
&mut self,
frequency: CandyFrequency<T>
) -> &mut Self
Set task Frequency by customized CandyCronStr.
In order to build a high-performance,
highly reusable TaskBuilder
that maintains the Copy feature .
when supporting building from CandyCronStr , here actively leaks memory for create a str-slice (because str-slice support Copy, String does not)
We need to call free
manually before TaskBuilder
drop or before we leave the scope.
Explain:
Explicitly implementing both Drop
and Copy
trait on a type is currently
disallowed.
This feature can make some sense in theory, but the current
implementation is incorrect and can lead to memory unsafety (see
(issue #20126), so it has been disabled for now.
This api will be deprecated in the future, please use set_frequency_*_by_candy
etc.
Set task-id.
Set maximum execution time (optional).
pub fn set_maximum_parallel_runnable_num(
&mut self,
maximum_parallel_runnable_num: u64
) -> &mut Self
pub fn set_maximum_parallel_runnable_num(
&mut self,
maximum_parallel_runnable_num: u64
) -> &mut Self
Set a task with the maximum number of parallel runs (optional).
pub fn set_schedule_iterator_time_zone(
&mut self,
schedule_iterator_time_zone: ScheduleIteratorTimeZone
) -> &mut Self
pub fn set_schedule_iterator_time_zone(
&mut self,
schedule_iterator_time_zone: ScheduleIteratorTimeZone
) -> &mut Self
Set time zone for cron-expression iteration time.
Spawn a task.
If we call set_frequency_by_candy explicitly and generate TaskBuilder,
We need to call free
manually before TaskBuilder
drop or before we leave the scope.
Explain:
Explicitly implementing both Drop
and Copy
trait on a type is currently
disallowed. This feature can make some sense in theory, but the current
implementation is incorrect and can lead to memory unsafety (see
(issue #20126), so it has been disabled for now.
So I can’t go through Drop and handle these automatically.
Task execution frequency: execute only once, set by cron expression.
Task execution frequency: countdown execution, set by cron expression.
pub fn set_frequency_count_down_by_cron_str(
&mut self,
cron_str: &'a str,
count_down: u64
) -> &mut Self
pub fn set_frequency_count_down_by_cron_str(
&mut self,
cron_str: &'a str,
count_down: u64
) -> &mut Self
Task execution frequency: execute repeatedly, set by cron expression.
Task execution frequency: execute only once, set by seconds num.
Make sure time is greater than 1 seconds, otherwise undefined behavior will be triggered.
Task execution frequency: countdown execution, set by seconds num.
Make sure time is greater than 1 seconds, otherwise undefined behavior will be triggered.
pub fn set_frequency_count_down_by_seconds(
&mut self,
seconds: u64,
count_down: u64
) -> &mut Self
pub fn set_frequency_count_down_by_seconds(
&mut self,
seconds: u64,
count_down: u64
) -> &mut Self
Task execution frequency: execute repeatedly, set by seconds num.
Make sure time is greater than 1 seconds, otherwise undefined behavior will be triggered.
Task execution frequency: execute only once, set by minutes num.
Make sure time is greater than 1 seconds, otherwise undefined behavior will be triggered.
Task execution frequency: countdown execution, set by minutes num.
Make sure time is greater than 1 seconds, otherwise undefined behavior will be triggered.
pub fn set_frequency_count_down_by_minutes(
&mut self,
minutes: u64,
count_down: u64
) -> &mut Self
pub fn set_frequency_count_down_by_minutes(
&mut self,
minutes: u64,
count_down: u64
) -> &mut Self
Task execution frequency: execute repeatedly, set by minutes num.
Make sure time is greater than 1 seconds, otherwise undefined behavior will be triggered.
Task execution frequency: execute only once, set by hours num.
Make sure time is greater than 1 seconds, otherwise undefined behavior will be triggered.
Task execution frequency: execute repeatedly, set by hours num.
Make sure time is greater than 1 seconds, otherwise undefined behavior will be triggered.
Task execution frequency: countdown execution, set by hours num.
Make sure time is greater than 1 seconds, otherwise undefined behavior will be triggered.
Task execution frequency: execute only once, set by days num.
Make sure time is greater than 1 seconds, otherwise undefined behavior will be triggered.
Task execution frequency: execute repeatedly, set by days num.
Make sure time is greater than 1 seconds, otherwise undefined behavior will be triggered.
Task execution frequency: countdown execution, set by days num.
Make sure time is greater than 1 seconds, otherwise undefined behavior will be triggered.
pub fn set_frequency_once_by_timestamp_seconds(
&mut self,
timestamp_seconds: u64
) -> &mut Self
pub fn set_frequency_once_by_timestamp_seconds(
&mut self,
timestamp_seconds: u64
) -> &mut Self
Task execution frequency: execute only once, set by timestamp-seconds num.
Make sure time is greater than 1 seconds, otherwise undefined behavior will be triggered.
Trait Implementations
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl<'a> RefUnwindSafe for TaskBuilder<'a>
impl<'a> Send for TaskBuilder<'a>
impl<'a> Sync for TaskBuilder<'a>
impl<'a> Unpin for TaskBuilder<'a>
impl<'a> UnwindSafe for TaskBuilder<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more