-
Unified Isolate mechanism: In this release, two mechanisms used to provide support for effects with forking, Isolate and Boundary, were merged into a single implementation with better usability. Isolate.Contextual provides isolation for contextual effects like Env and Local, while Isolate.Stateful is a more powerful mechanism that is able to propagate state with forking and restore it. A few effects provide default Isolate instances but not all. For example, given the problematic semantics of mutable state in the presence of parallelism, Var doesn't provide an Isolate evidence, which disallows its use with forking by default and requires explicit activation (see Var.isolate.*). (by @fwbrasil in https://github.com/getkyo/kyo/pull/1077)
-
More convenient discarding methods: Methods that execute a provided function but don't use its result used to require functions to return Unit. In this release, methods were changed to accept Any as the result of the function. For example, the unit call in Resource.ensure(queue.close.unit) can now be omitted: Resource.ensure(queue.close). (by @johnhungerford in https://github.com/getkyo/kyo/pull/1070)
-
Less verbose errors: Kyo logs rich failures including a snippet of the failing code for a better development experience. This behavior is problematic in production systems due to the verbosity. A new Environment mechanism was introduced to detect if Kyo is executing in a development mode and disable the rich failure rendering if not. The detection mechanism currently only supports SBT, but the user can enable the development mode via a system property. (by @fwbrasil in https://github.com/getkyo/kyo/pull/1057)
-
Better resource handling in Hub: The init methods of Hub weren't attaching a finalizer via the Resource effect. This has been fixed in this release. (by @johnhungerford in https://github.com/getkyo/kyo/pull/1066)
-
Remove IOException from Console APIs: The Console methods used to indicate that the operation could fail with Abort[IOException], but that was an incorrect assumption. The underlying Java implementation doesn't throw exceptions and a separate method is provided to check for errors. Kyo now reflects this behavior by not tracking Abort[IOException] and providing a new Console.checkErrors method. (by @rcardin in https://github.com/getkyo/kyo/pull/1069)
-
Multi-get Env APIs: The new Env.getAll/useAll methods enable getting multiple values from the environment at once. For example: Env.getAll[DB & Cache & Config], which returns a TypeMap[DB & Cache & Config]. (by @fwbrasil in https://github.com/getkyo/kyo/pull/1099)
-
Rename run prefix in Stream: Some of the methods in Stream were prefixed with run to indicate that they will evaluate the stream, which wasn't very intuitive. The prefix was removed and, for example, Stream.runForeach is now Stream.foreach. (by @c0d33ngr in https://github.com/getkyo/kyo/pull/1062)
-
Non-effectful Stream methods: The methods in the Stream class were designed to assume that all operations are effectful, which introduces overhead due to the unnecessary effect handling when the function is effect-free. This release includes overloaded versions of methods, which allows the compiler to select the non-effectful version if possible. Benchmark results show a major improvement. (by @johnhungerford in https://github.com/getkyo/kyo/pull/1045)
-
Maybe.collect optimization: The method has been updated to use applyOrElse, which avoids the need to call the partial function twice. (by @matteobilardi in https://github.com/getkyo/kyo/pull/1083)
-
Path.readAll fix: The method wasn't returning the correct file names. (by @hearnadam in https://github.com/getkyo/kyo/pull/1090)