JobRF constructor
Implementation
JobRF(this.job, {this.duration, this.onComplete}) {
if (duration == null) {
job!.call();
} else {
if (!isBusy) {
isBusy = true;
Stream.periodic(Duration(seconds: 1)).listen((_) {
//_counter.increment();
job!.call();
sleep(duration!);
// _counter.updateComplete();
if (onComplete != null) onComplete!.call();
});
isBusy = false;
}
}
}