dbos-inc / dbos-transact-ts

The TypeScript framework for backends that scale
https://docs.dbos.dev
MIT License
373 stars 28 forks source link

Deactivate #647

Closed manojdbos closed 1 month ago

manojdbos commented 1 month ago

An admin api to stop scheduler and kafka consumers from processing events.

Processing will resume only when u restart the app

chuck-dbos commented 1 month ago

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.

manojdbos commented 1 month ago

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 ?

chuck-dbos commented 1 month ago

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.