-
Notifications
You must be signed in to change notification settings - Fork 31
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
Deactivate #647
Deactivate #647
Conversation
src/dbos-executor.ts
Outdated
@@ -928,6 +932,13 @@ export class DBOSExecutor implements DBOSExecutorContext { | |||
return handlerArray; | |||
} | |||
|
|||
async deactivateConsumers() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: deactivateEventReceivers
would be more consistent :)
for (const evtRcvr of this.eventReceivers || []) { | ||
await evtRcvr.destroy(); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this also shut down the queue polling loop, or does that need to be done elsewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume you are referring to the WF Queue runner. Will add the code to shut that down as well
I wonder if we can put this together into one PR. I needed to restart some of the services in the testing runtime to test their makeup work. |
@chuck-dbos I did not understand the comment. Do you want to combine this PR with another PR ? |
In a recent PR I added a function called "async destroyEventReceivers" to testing runtime. We should make the one in the real runtime the same, maybe combine into one function. In the next PR, I found I want to call this during a test to simulate shutdown and restart. But this wasn't part of the public API of the testing runtime, so I temporarily hacked it on that branch. I am wondering if we can put all the pieces together into one, public API method, that exists on both the real and the test runtime, that deactivates all of the background stuff (event receivers, scheduler, internal kafka) and one to start it back again. |
An admin api to stop scheduler and kafka consumers from processing events.
Processing will resume only when u restart the app