gajus / turbowatch

Extremely fast file change detector and task orchestrator for Node.js.
Other
938 stars 23 forks source link

Better updated docs for shutdown and abort controller #44

Closed DesignByOnyx closed 1 year ago

DesignByOnyx commented 1 year ago

The docs describe gracefully terminating with examples using an abort signal or a shutdown method, neither of which are available:

image

Is there a recommended way to gracefully terminate?

DesignByOnyx commented 1 year ago

OK - I see that I can await watch(...) to get the controller. I'll keep this open so the docs get updated, and I'd like feedback on the abort signal as I'd prefer use that.

gajus commented 1 year ago

Where in documentation does this lack clarity?

DesignByOnyx commented 1 year ago

The screenshot shows what is wrong with the current docs, I'll summarize here:

  1. const { shutdown } = watch(...) does not work. You must await watch(...).
  2. abortSignal is not a valid option, though this would be really nice to have.

https://github.com/gajus/turbowatch/compare/main...DesignByOnyx:designbyonyx/docs-update?expand=1

gajus commented 1 year ago

abortSignal is not a valid option, though this would be really nice to have.

What benefit would that have over the current shutdown method?

github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 2.24.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

DesignByOnyx commented 1 year ago

What benefit would that have over the current shutdown method?

Shutdown works fine. It would just be nice alternative to shutdown which reinforces a good pattern for dealing with multiple related async tasks. It's not a big deal though. I really appreciate all the work you've done!

gajus commented 1 year ago

FYI it's been added.