-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If schedular is stateless, how do I invoke the stop() function at a later time? #211
Comments
@kibertoad The only thing I have in mind, which feels a bit of a hack, is to use an external json file to set a start/stop flag. Although I use a json file for config etc anyway. So what I have in mind is that my |
@khan-zia Can you explain a bit more what you are trying to achieve? If you want to stop all jobs at once, you can call |
@kibertoad my use case is a bit different. I have a node CLI. When I invoke the Now, the other command I have is PS. |
You can achieve this in a MacOS or Linux environment by using one or more named (FIFO) pipes. Basically, you'd author your Node.js daemon (the one in which you do the toad-scheduler stuff) such that you initialize it with a path to a FIFO pipe. When something writes to the FIFO pipe, you do your shutdown sequence. You could add a second FIFO pipe to which your daemon could write some bytes when shutdown has completed. Then, you'd author your |
I ended up with something even more straightforward that just works regardless of the operating system or anything else. I wrote a small script in |
I am sorry to be asking a rather simple question here, I tried and went through the codebase but I figured I still need some input from your side.
I have a simple use case. I have a node.js CLI app. When I run a certain command, I schedule a few jobs and the node execution that queues and starts the jobs exits of course. Now, I would like to have another CLI command let's say
myapp stop
that should be able to stop all previously enqueued jobs. As per my understanding, the new node process executing themyapp stop
command would have no link whatsoever to anything the toad schedular is doing in memory. Take a look at this snippent.As you can see, the
beginScheduledJobs()
method would be called by my appsstart
command, and thestopScheduledJobs
is to be called on-demand by the user later by my app'sstop
command. Any help would be greatly appreciated.The text was updated successfully, but these errors were encountered: