JakeWharton / JakeWharton/finalization-hook

Consider providing block result to hook lambda

Open
#7 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Kotlin
Stars
76
Forks
0
Avg merge
19h 40m
Merged PRs (30d)
13

Description

Biggest problem is that we don't get signal information on the JVM aside from just being able to infer we were signaled.

Maybe
```kotlin
sealed interface BlockResult {
data object Success : BlockResult
data class Failure(val t: Throwable) : BlockResult {
val isCancellation: Boolean get() = t is CancellationException
}
data class Signalled(val signal: Int?) : BlockResult
}
```

where the JVM gets a null signal value, and Windows gets only `SIGINT`?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the hook lambda API and the platform-specific JVM and Windows signal handling mentioned in the issue. Define how the proposed BlockResult variants and platform-specific signal values should be exposed, then verify success, failure, cancellation, and signalling behavior across those platforms.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.