Commit Graph

31 Commits

Author SHA1 Message Date
Michael Bull b19894a08c Deprecate suspending variant of "binding" in favour of "coroutineBinding"
This matches the internally-called function named coroutineScope, and helps
consumers distinguish between the blocking variant that is otherwise only
differing in package name.

This should also help convey to readers that structured concurrency will
occur within the block.
2024-03-11 00:06:46 +00:00
Michael Bull dd5c96f983 Deprecate "ResultBinding" in favour of "BindingScope"
This matches the Kotlin stdlib naming convention used for
sequences[1] and coroutines[2].

[1] https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.sequences/-sequence-scope/
[2] https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-scope/
2024-03-11 00:06:46 +00:00
Michael Bull ab06a2a3fc Run coroutine tests on all platforms
Some were previously restricted to specific platforms, however
kotlinx-coroutines-test now targets them all.
2024-03-11 00:06:46 +00:00
Michael Bull 0b21b7361f Replace lateinit with null in binding variants 2024-03-11 00:06:46 +00:00
Michael Bull fec8c03313 Use delegation for SuspendableResultBindingImpl
The Kotlin docs for CoroutineScope[1] explicitly state that:

"Manual implementation of this interface is not recommended,
implementation by delegation should be preferred instead."

[1] https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-scope/
2024-03-11 00:06:46 +00:00
Michael Bull 01c8c00f98 Rename error to result in binding impls 2024-03-08 14:46:59 +00:00
Michael Bull 5c4635b655 Reformat project 2024-03-08 14:46:59 +00:00
Michael Bull 104f6a8ecd Mark objects as data objects in tests 2024-03-08 14:46:59 +00:00
Michael Bull d8ea6e1c04 Move binding type declarations to lefthand of callsite 2024-03-08 14:46:59 +00:00
Michael Bull f05ce6e0c7 Improve consistency across unit tests 2024-03-08 14:46:59 +00:00
Michael Bull 88e31cd1ac Extract shared build logic to convention plugins
See: https://docs.gradle.org/current/userguide/sharing_build_logic_between_subprojects.html#sec:convention_plugins
2024-03-03 00:02:54 +00:00
Michael Bull 05a1e91298 Update Kotlin to 1.9.20
Adopts the new default project template[1] and removed mpp targets[2].

[1] https://kotlinlang.org/docs/whatsnew1920.html#template-for-configuring-multiplatform-projects
[2] https://kotlinlang.org/docs/whatsnew1920.html#change-to-our-target-tiers-policy

See: https://kotl.in/native-targets-tiers
2024-01-23 13:14:37 +00:00
Matthias Geisler 41fff9eb9c Migrate to Gradle version catalog
Closes #83
2023-04-03 11:46:53 +01:00
Matthew Nelson bdd29833a7 Use api in lieu of implementation
Closes #82
2023-02-07 15:34:01 +00:00
Michael Bull 72df4c0ff6 Update kotlinx-coroutines to 1.6.0
Closes #69
2022-01-08 13:11:58 +00:00
Joseph Cooper 2667273015 Add runSuspendCatching and T#runSuspendCatching
Closes #67
2021-10-27 15:53:11 +01:00
Joseph Cooper 4e1bb9d8de Replace usages of useExperimentalAnnotation
Fix warnings on kotlin-result/build.gradle.kts and
kotlin-result-coroutines/build.gradle.kts caused by using deprecated
useExperimentalAnnotation function.
2021-10-12 08:32:42 +01:00
Tristan 07b4d61d3f resolve flaky jvm multi threaded coroutine tests
By switching to using the jvm only (hopefully by 1.6 in common) coroutine test lib we can swap to using a fake dispatcher instead of defining threads which should resolve any odd timing issues.
2021-08-13 22:57:27 +01:00
Jordan Bergin d64837f2f8 Update Kotlin to 1.5.10 2021-06-12 16:10:41 +01:00
Tristan Hamilton f2bd9aaa11 Correctly cancel child jobs in suspending variant of binding
Closes #46
2021-05-05 14:31:34 +01:00
Michael Bull a5c153477b Reformat runBlockingTest implementations 2021-05-05 14:05:18 +01:00
Avently c4c70b4d98 Add Linux, Windows and MacOS targets 2021-03-29 18:41:20 +01:00
Tristan Hamilton ccb9c5b3aa Add iOS build targets 2021-02-10 15:45:16 +00:00
Jan Müller 0f90bb8b90
Add JS targets for Kotlin Multiplatform (#36) 2020-11-29 21:34:08 +00:00
Tristan H c8372a0522
Eagerly cancel async bindings (#37)
Make suspendible binding function eagerly cancel child jobs by cancelling wrapping scope
2020-11-28 22:50:10 +00:00
Tristan Hamilton a9a0c384f4 Use Explicit API mode
See: https://kotlinlang.org/docs/reference/whatsnew14.html#explicit-api-mode-for-library-authors
2020-08-29 11:40:48 +01:00
Tristan Hamilton 620f434220 Remove unused dependencies 2020-08-29 11:35:03 +01:00
Michael Bull 41269f06d3 Extract dependency versions to Versions object in buildSrc 2020-08-26 19:52:18 +01:00
Michael Bull b123921ba5 Make runBlockingTest match signature of kotlinx-coroutines-test 2020-08-26 19:26:02 +01:00
Michael Bull 30b5d918c7 Fix missing project descriptions in pom files 2020-08-26 16:50:36 +01:00
Tristan Hamilton b16fb559a1 Move binding coroutine implementation to separate subproject 2020-08-25 22:29:50 +01:00