clime icon indicating copy to clipboard operation
clime copied to clipboard

[Question] How implement shutdown

Open galkin opened this issue 5 years ago • 3 comments

Thank you for awesome package. Some of my command can take more than 3 minutes. Do we have best practice for shutdown the command execution?

galkin avatar Apr 05 '19 09:04 galkin

Hi, are those commands synchronous or asynchronous? And who will perform the "shutdown" operation? Ctrl+C or the command itself?

vilicvane avatar Apr 05 '19 10:04 vilicvane

Hi, are those commands synchronous or asynchronous?

asynchronous with async/await

And who will perform the "shutdown" operation?

User press Ctrl+C, command should graceful shutdown. For example, disconnect from DB, close file, etc.

galkin avatar Apr 05 '19 10:04 galkin

I see, currently I don't think there are direct related features implemented by clime. To be honest, I don't think the Promise idea behind clime is suitable for describing this. RxJS might serve this purpose better though.

I think I could add a built-in shim with RxJS support in future versions, the core might need a little bit modification for types.

vilicvane avatar Apr 05 '19 11:04 vilicvane

closed as clime didn't receive updates for long time

galkin avatar Mar 17 '23 03:03 galkin