Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to terminate ActionTriggers right way
#1
Hallo,
I'm plan to use LibreAutomate-Nuget-Package inside a windows service to respond on third party windows etc. with configured ActionTriggers.
After creating the trigger functions, I'll call ActionTriggers.RunThread() infinitly. If the service itself should be terminating I currently see no option to inject a CancellationToken as it would be normally. Additionally the host machine use hybernating states and wakeup or resume later but normally never will be shutdown fully - so killing threads or creating zombies is not really a good option (also I look to prevent memory leaks).

I would therefore suggest to extend the library with following member function:
async Task ActionTrigger.ExecuteAsync(CancellationToken stoppingToken)

If there is already a way to safely cancel ActionTrigger Tasks by sending messages to thread or other solutions, I would love to know more about it.

Thanks in advance for any advice.


Messages In This Thread
How to terminate ActionTriggers right way - by AutoStarter - 03-06-2026, 10:22 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)