arkhipenko / TaskScheduler

Cooperative multitasking for Arduino, ESPx, STM32, nRF and other microcontrollers
http://playground.arduino.cc/Code/TaskScheduler
BSD 3-Clause "New" or "Revised" License
1.23k stars 224 forks source link

Is running? #61

Closed dragoblaztr closed 6 years ago

dragoblaztr commented 6 years ago

is there a method or so to know if any specific task is running?

or in the worst case what would happen if do I try to disable and delete any in-existent task?

Best regards

arkhipenko commented 6 years ago

TaskScheduler, being a cooperative scheduler, is inherently single-threaded. Therefore, only one task is truly running at a time. In other words: if a task1 is able to query the status of task2, then task1 is active (running) and task2 is inactive (not running). It is always like this, so no additional method is needed.

If you rather want to know if a task is enabled, then there is a method: task.isEnabled(). https://github.com/arkhipenko/TaskScheduler/wiki/API-Task#bool-isenabled

dragoblaztr commented 6 years ago

So is there any method to know what task are scheduled for running?

dragoblaztr commented 6 years ago

My case is I want to stop and delete for schedule any specific task but it depends to be running on specific condition it whatever be running and existing or not? am I so specific?

arkhipenko commented 6 years ago

Could you please describe your specific use case? The question is very broad. All enabled tasks on a chain are scheduled to run either on an event or after a specific time interval.

arkhipenko commented 6 years ago

This is method is explained in the wiki. Could you please check there first?

On Aug 24, 2018 5:42 PM, dragoblaztr notifications@github.com wrote:

I was digging in the source files and I found isEnabled(), can you explain how to this work because I looked at examples without luck.

Thanks

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/arkhipenko/TaskScheduler/issues/61#issuecomment-415889966, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AATGTRZE-edDfpMcfo6hew2_OrBymTbGks5uUHMwgaJpZM4WCCtc.