breejs / bree

Bree is a Node.js and JavaScript job task scheduler with worker threads, cron, Date, and human syntax. Built for @ladjs, @forwardemail, @spamscanner, @cabinjs.
https://jobscheduler.net
MIT License
3.01k stars 78 forks source link

How can send a message from Main thread to a Bree job #122

Closed ilovebioz closed 3 years ago

ilovebioz commented 3 years ago

I want to stop a job when it is running. To do this, I think I need to send a message from the main thread to the job. But I don't know how to do it. Pls help.

shadowgate15 commented 3 years ago

You can do this by calling bree.stop('jobName')

this will then send a message called 'cancelled' to worker. See this