Update bare lifecycle methods (#180)

* Update bare API docs to 1.17.1

* Add Options section on Bare building configuration

* Update Bare module list to 1.17.1
This commit is contained in:
Sean Zellmer
2025-03-27 13:32:46 -05:00
committed by GitHub
parent c966f41503
commit 0d7fbfe0c3
3 changed files with 77 additions and 53 deletions

View File

@@ -52,7 +52,11 @@ Immediately terminate the process or current thread with an exit status of `code
### `Bare.suspend([linger])`
Suspend the process and all threads. This will emit a `suspend` event signalling that all work should stop immediately. When all work has stopped and the process would otherwise exit, an `idle` event will be emitted. If the process is not resumed from an `idle` event listener and no additional work is scheduled, the loop will block until the process is resumed. If additional work is scheduled from an `idle` event, the `idle` event will be emitted again once all work has stopped unless the process was resumed.
Suspend the process and all threads. This will emit a `suspend` event signalling that all work should stop immediately. When all work has stopped and the process would otherwise exit, an `idle` event will be emitted. If the process is not resumed from an `idle` event listener, the loop will block until the process is resumed.
### `Bare.idle()`
Immediately suspend the event loop and trigger the `idle` event.
### `Bare.resume()`
@@ -92,11 +96,11 @@ Emitted after the process or current thread has terminated and before the JavaSc
### `Bare.on('suspend', linger)`
Emitted when the process or current thread is suspended. Any in-progress or outstanding work, such as network activity or file system access, should be deferred, cancelled, or paused when the `suspend` event is emitted and no additional work may be scheduled.
Emitted when the process or current thread is suspended. Any in-progress or outstanding work, such as network activity or file system access, should be deferred, cancelled, or paused when the `suspend` event is emitted and no additional work should be scheduled.
### `Bare.on('idle')`
Emitted when the process or current thread becomes idle after suspension. If no additional work is scheduled from this event, the loop will block and no additional work be performed until the process is resumed. An `idle` event listener may call `Bare.resume()` to cancel the suspension.
Emitted when the process or current thread becomes idle after suspension. After all handlers have run, the event loop will block and no additional work be performed until the process is resumed. An `idle` event listener may call `Bare.resume()` to cancel the suspension.
### `Bare.on('resume')`
@@ -170,3 +174,11 @@ Whether or not the thread has been joined with the current thread.
### `thread.join()`
Block and wait for the thread to exit.
### `thread.suspend([linger])`
Suspend the thread. Equivalent to calling `Bare.suspend()` from within the thread.
### `thread.resume()`
Resume the thread. Equivalent to calling `Bare.resume()` from within the thread.