You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by the_palakkaran <ji...@suntecsbs.com> on 2018/10/08 05:13:11 UTC
How to schedule and ignite service to run every 5 seconds?
The default scheduling happens every 1 minute. Is it possible to override it
and make it every 5 seconds?
SchedulerFuture<?> schedulerFuture = ignite.scheduler().scheduleLocal(
new Callable<Integer>() {
private int invocations = 0;
@Override
public Integer call() {
invocations++;
ignite.compute().broadcast(
new IgniteRunnable() {
@Override public void run() {
System.out.println("Running");
}
}
);
return invocations;
}
},
"{5, 3} * * * * *" // Cron expression.
);
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Re: How to schedule and ignite service to run every 5 seconds?
Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!
ignite-schedule works with CRON expressions and cron4j underneath, which
does not support granularity finer than one minute.
Regards,
--
Ilya Kasnacheev
пн, 8 окт. 2018 г. в 8:13, the_palakkaran <ji...@suntecsbs.com>:
> The default scheduling happens every 1 minute. Is it possible to override
> it
> and make it every 5 seconds?
>
> SchedulerFuture<?> schedulerFuture = ignite.scheduler().scheduleLocal(
> new Callable<Integer>() {
> private int invocations = 0;
>
> @Override
> public Integer call() {
> invocations++;
> ignite.compute().broadcast(
> new IgniteRunnable() {
>
> @Override public void run() {
>
> System.out.println("Running");
> }
> }
> );
> return invocations;
> }
> },
> "{5, 3} * * * * *" // Cron expression.
> );
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>