Terminating Nestjs Service Effect on Server Shutdown
In Nestjs Service I have an effect running, I want to terminate it as soon as server is shutdown,
I wonder how could I achieve it elegantly
I wonder how could I achieve it elegantly
class TestService {
shutdown = false;
onModuleDestroy(){
this.shutdown = true
}
async process(){
await Effect.runPromise(EffectA)
}
}