Skip to content

Commit

Permalink
Prepare 0.1.0-beta02 release
Browse files Browse the repository at this point in the history
  • Loading branch information
05nelsonm committed Jun 19, 2024
1 parent e6fa758 commit d884caf
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 3 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# CHANGELOG

## Version 0.1.0-beta02 (2024-06-19)
- Fixes issue for `Node.js` on Windows where `Process.destroy` may
throw exception due to a bug in `libuv` version `1.48.0` which was
introduced in `Node.js` version `21.6.2` [[#111]][111]
- See issue [[#108]][issue-108] for details.
- Adds the `Process.exitCodeOrNull` function to mitigate unnecessary
production of stack traces [[#112]][112]
- Adds an exception handling API for dealing with "internal-ish" `Process`
errors, and "bad" `OutputFeed` implementations [[#113]][113]
- By default `ProcessException.Handler.IGNORE` is utilized which
preserves the behavior of previous versions of `kmp-process`.

## Version 0.1.0-beta01 (2024-06-15)
- `AsyncWriteStream` improvements for `Node.js` implementation [[#98]][98]
- `unref` is now called on `Process` when destroyed for `Node.js` [[#100]][100]
Expand Down Expand Up @@ -41,3 +53,8 @@
[100]: https://github.com/05nelsonm/kmp-process/pull/100
[106]: https://github.com/05nelsonm/kmp-process/pull/106
[107]: https://github.com/05nelsonm/kmp-process/pull/107
[111]: https://github.com/05nelsonm/kmp-process/pull/111
[112]: https://github.com/05nelsonm/kmp-process/pull/112
[113]: https://github.com/05nelsonm/kmp-process/pull/113

[issue-108]: https://github.com/05nelsonm/kmp-process/issues/108
40 changes: 38 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,42 @@ myScope.launch {

println("EXIT_CODE[$exitCode]")
}

// Error handling API for "internal-ish" process errors.
// By default, ProcessException.Handler.IGNORE is used,
// but you may supplement that with your own handler.
builder.onError { e ->
// e is always an instance of ProcessException
//
// Throwing an exception from here will be caught,
// the process destroyed (to prevent zombie processes),
// and then be re-thrown. That will likely cause a crash,
// but you can do it and know that the process has been
// cleaned up before getting crazy.

when (e.context) {
ProcessException.CTX_DESTROY -> {
// Process.destroy had an issue, such as a
// file descriptor closure failure on Native.
e.cause.printStackTrace()
}
ProcessException.CTX_FEED_STDOUT,
ProcessException.CTX_FEED_STDERR -> {
// An attached OutputFeed threw exception
// when a line was dispatched to it. Let's
// get crazy and potentially crash the app.
throw e
}
// Currently, the only other place a ProcessException
// will come from is the `Node.js` implementation's
// ChildProcess error listener.
else -> e.printStackTrace()
}
}.spawn { p ->
p.stdoutFeed { line ->
myOtherClassThatHasABugAndWillThrowException.parse(line)
}.waitFor()
}
```

## Get Started
Expand All @@ -179,12 +215,12 @@ myScope.launch {

```kotlin
dependencies {
implementation("io.matthewnelson.kmp-process:process:0.1.0-beta01")
implementation("io.matthewnelson.kmp-process:process:0.1.0-beta02")
}
```

<!-- TAG_VERSION -->
[badge-latest-release]: https://img.shields.io/badge/latest--release-0.1.0--beta01-blue.svg?style=flat
[badge-latest-release]: https://img.shields.io/badge/latest--release-0.1.0--beta02-blue.svg?style=flat
[badge-license]: https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat

<!-- TAG_DEPENDENCIES -->
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ POM_DEVELOPER_ID=05nelsonm
POM_DEVELOPER_NAME=Matthew Nelson
POM_DEVELOPER_URL=https://github.com/05nelsonm/

VERSION_NAME=0.1.0-beta02-SNAPSHOT
VERSION_NAME=0.1.0-beta02
# 0.1.0-alpha01 = 00 01 00 11
# 0.1.0-beta01 = 00 01 00 41
# 0.1.0-rc01 = 00 01 00 71
Expand Down

0 comments on commit d884caf

Please sign in to comment.