Zio-py

Latest version: v0.0.16

Safety actively analyzes 630360 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 12 of 20

1.0.0rc20

This release features a number of important bugfixes for ZStream. Upgrading is advised!

Notable changes

ZIO Core

The return type for the `run` method in `zio.App` has changed to `ZIO[ZEnv, Nothing, ExitCode]`. `ExitCode` is a simple wrapper around an integer, with handy constructors for error and success (`ExitCode.success`, `ExitCode.failure`). In addition, a convenience combinator `ZIOexitCode` was added that converts a `ZIO` value to an `ExitCode`.

* **[Breaking]** Add App ExitCode (3583) (by luis3m)
* Add ChunknonEmptyOrElse (3687) (by simpadjo)
* Implement Fast Single Element Append for Chunk (3416) (by adamgfraser)
* Fix Chunk.splitWhere (3644) (by KadekM)
* Add combinators collectSome and collectSomePar (3568) (by ghidei)
* Add ZIOvalidateWith (3617) (by luis3m)
* ensure ZIOfromFutureJava runs the parameter only once (3702) (3704) (by fsarradin)

ZIO Streams

We've seen in the last release that removing `Take[E, A]` and relying on `Exit[Option[E], Chunk[A]]` instead degrades ergonomics significantly when working with ZStream. So we went ahead and re-added it, this time as a wrapper over `Exit[Option[E], Chunk[A]]`. Apologies for the inconvenience!

* Modify ZStreammergeWith implementation to use a queue (3691) (by luis3m)
* **[Breaking]** Add back ZStream.Take (3669) (by luis3m)
* Modify ZStreamdebounce to take chunk last element (3689) (by luis3m)
* Fix ZTransducer.splitLines (3690) (by iravid)
* Fix debounce to properly handle empty chunks (3611) (by luis3m)
* Fix memory leak in ZStreamforever (3681) (by iravid)
* Add ZStreamzipWithNext & ZStreamzipWithPrevious (3596) (by luis3m)
* Allow schedule on ZStream.repeatEffectWith rely on effect value (3618) (by luis3m)
* Fix ZStream.fromInputStream (3678) (by iravid)
* Maintain ZStream's laziness on chunks at the expense of performance (3666) (by iravid)
* Add ZStreamflattenTake (3661) (by luis3m)
* Fix ZSinkcollectAllWhileWith (3665) (by simpadjo)
* **[Breaking]** ZSink.fromOutputStream should return Long (3652) (by simpadjo)
* Fix ZStreamtoInputStream error handling (3700) (by simpadjo)
* Add ZStream.fromFile (3697) (by iravid)

ZIO Test

* ZIO Test: Close Resources Earlier In ProvideLayerShared (3696) (by adamgfraser)

1.0.0rc19

Another packed release! This version features tons of improvements to existing data types and exciting changes to ZIO Streams. Read on for more details!

A note on our roadmap

Although we've promised that RC18 would be the last (or one-before-last) release before the mythical 1.0.0 release, we've seen some regressions caused by the supervision changes introduced in RC18.

We have an exciting refinement to the model coming up in the following weeks. It is not included in this release, but will be included in the next one. Therefore, we anticipate that after RC19, we will release between 1-2 additional versions: one containing the supervision refinement, and optionally another release with follow-ups.

We appreciate your patience and help in using ZIO and sending feedback and bug reports!

Notable changes

ZIO Core

In this release a `foldAll` combinator has been added to `ZRef` that allows transforming a `Ref` by "zooming in" on one field in a case class or data structure. This allows `Ref` and friends to function as concurrent optics. A separate ZIO Optics library will be released in the near future with tools for doing this and ways to lift optics from existing libraries to work with `ZRef`.

* implement retry (3566) (by adamgfraser)
* Add ZIO.tupled (3565) (by luis3m)
* Redesign ZManaged around an embedded ReleaseMap (3510) (by iravid)
* Add someOrElse to ZSTM, ZIO and ZManaged (3560) (by valenterry)
* Add Schedule noDelay and run (3554) (by reibitto)
* Explore Initial Encoding of ZLayer (3483) (by adamgfraser)
* Add Operators (3541) (by adamgfraser)
* Add ZQueue.takeBetween (3520) (by mijicd)
* Synchronize Tag typeclass naming with izumi-reflect, rename Tagged->Tag, deprecate old names (3508) (by neko-kai)
* improve reentrant lock performance (3099) (by unclebob418)
* Add NonEmptyChunk constructors (3517) (by simpadjo)
* implement ZLayertapError (3505) (by adamgfraser)
* Add ZIOfilterNot and ZSTMfilterNot (3477) (by taeguk)
* Use ChunkBuilder more prominently in Chunk (3453) (by mschuwalow)
* Implement ZManageduseNow (3466) (by adamgfraser)
* Implement ZManagedflattenM (3464) (by adamgfraser)
* Implement ZIOservice (3422) (by adamgfraser)
* Add specialized accessor operations to Chunk (3431) (by whysoserious)
* Scala.js upgrade to v1.0.0 (2392) (2479) (by lvitaly)
* Back up Chunk[Boolean] by Chunk.BitChunks (3419) (by whysoserious)
* Optimize TQueue (3421) (by mijicd)
* Add alternative combinator to ZSTM (3414) (by mijicd)
* implement ZLayerlaunch (3415) (by adamgfraser)
* Improve TArray's performance (3407) (by mijicd)
* Implement ZIOmapEffect (3404) (by adamgfraser)
* Implement ZRefM (3391) (by adamgfraser)
* Boost TMap performance (3382) (by mijicd)
* Improve Support for NonEmptyChunk (3374) (by adamgfraser)
* Add support for setting Random seed (3367) (by reibitto)
* drop implicit CanFail constraint from stm orElse combinator (and related ones) (3370) (by swachter)
* implement variants for other ZIO effect types (3351) (by adamgfraser)
* Make Chunk Extend IndexedSeq (3342) (by adamgfraser)
* Improve TMap's performance (3343) (by mijicd)
* Implement BitChunk (3318) (by adamgfraser)
* implement orElseOptional (3339) (by adamgfraser)
* Bring Chunk to (Z)STM (3345) (by mijicd)
* Improve TMap transformations (3340) (by mijicd)
* Implement Optics for ZRef (3258) (by adamgfraser)
* Improve Error Messages with Has (3319) (by adamgfraser)
* implement corresponds (3320) (by adamgfraser)
* Performance on Chunk.apply (3297) (by ahoy-jon)
* implement convenience methods (3313) (by adamgfraser)
* Optimize unsafe ZQueue methods (3274) (by mijicd)
* Prototype for NonEmptyChunk (3241) (by ahoy-jon)
* implement unwrap (3267) (by adamgfraser)
* add andTo and >+> to ZLayer (3269) (by felher)
* Introduce ZTRef (3266) (by vasilmkd)
* Improve fiber dump output (3192) (by simpadjo)
* core: Add `unless/unlessM` as dual of `when/whenM` (3259) (by sirthias)
* Add *WithTrace variants for error handling combinators (3145) (by mvv)
* implement envs and properties (3244) (by adamgfraser)
* implement isFailure and isSuccess (3228) (by adamgfraser)
* JS Promise interop (3163) (by vasilmkd)
* implement ++ (3224) (by adamgfraser)
* implement fromDuration (3221) (by adamgfraser)
* Check if queue is empty before polling (3222) (by mijicd)
* Improve ZQueue performance (3216) (by mijicd)
* implement dimap (3209) (by adamgfraser)
* ZIO Core: Implement CausestripDefects (3206) (by adamgfraser)
* Prevent retry storms on ZSTM (3210) (by mijicd)
* ZIO Core: Disconnect Children in Uninterruptible Race (3125) (by adamgfraser)
* Add managed option combinators (3186) (by paulpdaniels)
* Add operator alias for `andThenEither` (3185) (by ioleo)
* implement forkAs (3131) (by adamgfraser)
* Implement ZIOcollectAll_ (3148) (by adamgfraser)
* Implement Randombetween (3149) (by adamgfraser)
* fix randomDelay (3147) (by adamgfraser)
* Add STM aliases (3129) (by mijicd)
* ZIO Core: Add Named Aliases for ZLayer Operators (3116) (by adamgfraser)
* Port reject/rejectM to ZManaged (3109) (by vpavkin)

ZIO Streams

This release features a major re-design to the ZIO Streams module:
- All `ZStream` operators now work on chunks. Previously, to work with chunked streams, one would need to use `ZStreamChunk`. That data type is now deleted and instead all operators benefit from chunking automatically.

- `ZSink` has been radically simplified.

The previous implementation featured *leftovers*: a property made it possible to use `ZSink` as a streaming parser. We've come to realize that any parser implemented using `ZSink`'s combinators is probably slow and inefficient compared to an actual parser library. Moreover, we would never be able to match the performance of parsing libraries while maintaining `ZSink`'s generality.

Instead, we've decided to re-focus `ZSink` on modeling aggregations and accumulations. It is now more limited, but more efficient and easier to use: the purpose of `ZSink` is to process a stream and emit *one* final result.

If you've been using `ZSink` for aggregations (using `ZSink.foldLeft` and other operators), you should see little change to your code. In some cases, operators that were previously sinks have been migrated to `ZTransducer` - see next bullet point.

For actual parsing usecases, stay tuned to the github.com/zio/zio-codecs project. Some exciting developments are in work there!

- `ZTransducer` has been added to accomodate aggregations that emit *multiple* results.

Whereas `ZSink`'s purpose is to return *one* final result when processing a stream, there are several usecases where it makes sense to process a stream and emit *multiple* results. For example - collecting elements into batches of a certain size; weighted folds; etc.

For these purposes, `ZTransducer` should now be used.

Big thanks to regiskuckaertz and simpadjo for their work on this re-design!

* Add termination strategies for ZStreammerge (3543) (by luis3m)
* Add ZStreaminterruptAfter and ZStreamhaltAfter (3534) (by luis3m)
* Modify ZStream.fromQueue to no longer use singleton chunks (3571) (by luis3m)
* Modify ZStreamtoIterator to use chunks (3569) (by luis3m)
* Add Transducerzip (3551) (by simpadjo)
* Implement ZStreamintersperse (3514) (by fagossa)
* Fix ZStream.toInputStream handling of signed bytes (3546) (by lancelet)
* add ZTransducermapOutput (3523) (by simpadjo)
* Add ZTransducer.splitOn (3519) (by regiskuckaertz)
* Add ZSinkmapError (3501) (by simpadjo)
* Redesign ZStream as the ZConduit hierarchy (3079) (by iravid)
* Add `ZStreamhaltWhen(IO)` and `ZStreaminterruptWhen(IO)` (3306) (by jeremyrsmith)
* Add ZStream.fromIterator versions that capture exceptions. (3195) (by alexknvl)
* ZStream error refinement. (3196) (by alexknvl)
* Added drop and skip constructors. (3190) (by alexknvl)
* Added ZStream.fromInputStreamEffect and ZStream.fromInputStreamManaged. (3198) (by alexknvl)

ZIO Test

In this release the implementation of `TestClock` has been updated. The concept of `fiberTime` has been eliminated. As a result, methods such as `currentTime` will always return the time that is set by the user using methods such as `setTime`. In addition, `adjust` will now suspend until all scheduled tasks have been completed. This should eliminate the need for external coordination such as promises and queues in most cases.

* ZIO Test: Make TestClock Run Effects In Order (3424) (by adamgfraser)
* ZIO Test: Improve Ergonomics of Laws for Higher Kinded Types (3356) (by adamgfraser)
* Fix handling of zero probability values in Gen.weighted (3544) (by felher)
* check bounds (3532) (by adamgfraser)
* ZIO Test: Improve Management of Resources in Specs (3456) (by adamgfraser)
* ZIO Test: Support Laws for Capabilities Parameterized on Two Types (3420) (by adamgfraser)
* Add AssertionM for effectfull assertions (3403) (by senia-psm)
* ZIO Test: Support Laws for Higher Kinded Types (3326) (by adamgfraser)
* implement generators for chunks (3321) (by adamgfraser)
* implement advance (3304) (by adamgfraser)
* Varargs support in mockable (3292) (by senia-psm)
* Varargs support in accessible (3283) (by senia-psm)
* implement GenbigDecimal (3295) (by adamgfraser)
* ZIO Test: Use Suite Execution Strategy in ProvideSomeLayerShared (3256) (by adamgfraser)
* implement bigInt (3282) (by adamgfraser)
* ZIO Mock support for impure methods, ZStream and ZSink (3247) (by ioleo)
* suspend generators (3245) (by adamgfraser)
* implement only test aspect (3248) (by adamgfraser)
* Rename TestAspect failure -> failing (3231) (by ioleo)
* ZIO Mock handle polymorphic methods (3136) (by ioleo)
* Add assertions to zio-test (3142) (by Michaelt293)
* ZIO Macros: Polymorphic accessors (3170) (by ioleo)
* Add isNative to TestAspect, TestPlatform, and TestAspectSpec (3160) (by LeeTibbert)
* Move macros into main repository (3122) (by ioleo)
* implement generators for map and set (3123) (by adamgfraser)
* add type aliases (3120) (by adamgfraser)
* ZIO Test: Implement Laws (3111) (by adamgfraser)

1.0.0rc18

ZIO 1.0.0-RC18 is the last expected release candidate for ZIO 1.0. There are no breaking changes between RC18 and 1.0, but no guarantees. The current plan is to release 1.0 within a few weeks after RC18, to ensure production-worthiness of 1.0.

**Note:** *All deprecated methods will be deleted for ZIO 1.0.*

ZIO Environment
Previously, the official recommended way to use ZIO Environment was to assemble pieces using inheritance to create larger environments out of smaller environments.

In the absence of proxies, this led to some pain around construction of the environment, because creating one class from other classes is not done using value-based operators, but inheritance-specific language features that do not permit abstraction.

Moreover, this approach had several drawbacks:

- Providing just part of an environment was difficult, and was not possible to do generically (the remaining part of the environment had to be known statically).
- It was not possible to dynamically update parts of the environment inside scoped regions, which led to pain when trying to customize services in parts of the application.

Finally, the principal way to make a first service depend on a second service was to list a reference to the second service inside the first (recalling the *Cake Pattern* self-type). This led to a pattern whereby business logic would express its dependencies by using ZIO Environment, but all other parts of the application would express their dependencies using fields.

These problems have been solved in RC18 with the introduction of two new data types: Has and ZLayer. Together they have led to a new pattern of encoding environmental dependencies, which has been rolled out in ZIO Core services (Clock, Console, Random, System).

While it is still technically possible to use the older pattern, the official ZIO ecosystem (all projects in the ZIO organization on Github) will be migrated to the new pattern.

Has

The new recommended way to assemble environments involves using a new structure called *Has*. The *Has* data type has operators for building bigger environments out of smaller environments, including add, which adds a service to a *Has*, and concat, which merges two *Has* into one.

ZLayer

ZLayer is a value that represents a recipe for constructing some services in terms of other services. It is similar to a constructor in a Java or Scala application, which takes the services it depends on, and returns the service it constructs (*constructor-based dependency injection*). Unlike constructors, however, ZLayers are first-class values that compose type-safely in several ways, and they can construct many services, not just one. Additionally, they can describe the effectful and resourceful construction, such as connecting to a database, creating a database thread pool, and when the service is no longer required, freeing the thread pool, and disconnecting from the database.

ZLayer represents the most power you could ever want in describing the construction of a service. In the end, almost all applications need something with this power (as witnessed by the fact that, generally, users of previous ZIO versions resorted to building the environment using ZManaged).

ZLayers can be constructed using a variety of constructors in the companion object of ZLayer. They can be composed horizontally (when one service depends on another), and vertically (for two independent services). Services that are repeated in the graph are automatically shared, to avoid duplicate construction and release. Further, services that can be constructed in parallel are automatically constructed in parallel, to optimize service construction time.

The general pattern of ZIO Environment is now as follows:

scala
type UserRepo = Has[UserRepo.Service]
object UserRepo {
trait Service { def getUserById(id: Id): Task[User] }

def getUserById(id: Id): RIO[UserRepo, User] = ZIO.accessM(_.get.getUserById(id))
}


Then typically, a `live` value is placed in the companion object of the service, which uses ZLayer to construct a production version of the service in terms of its dependencies:

scala
val live: ZLayer[Database, Nothing, UserRepo] = ???


Services may be provided to effects that need them using the ZIOprovideLayer method, e.g. `myEffect.provideLayer(UserRepo.live)`.

ZIO Runtime System

Weak automatic supervision

Supervision is now backed by weak sets, which means that child fibers may be freely garbage collected when they cannot resume. This should address memory leaks in scenarios where large numbers of non-terminating fibers are created.

Structured concurrency

All child fibers are automatically bound to their parent fiber. When the parent fiber exits, the child fiber will be interrupted or disowned, as determined by the `SuperviseMode` it is forked with. The default supervision mode for forked fibers is interruption, which means that by default, when a parent fiber exits, its child fibers will be interrupted. This ensures fibers do not leak.

In order to recapture the previous behavior, one may use `forkDaemon`, or `disown`, which explicitly disowns a child fiber and moves it to a root set of fibers.

Safer race

Race no longer forces either side to be interruptible. Users may have to perform `left.interruptible.race(right.interruptible)` to acquire the old behavior (which punched holes in uninterruptible regions); or possibly, `left.disconnect.race(right.disconnect)` (if they want the effects to be keep running when interrupted, but in the background).

New combinators

Several new combinators are added:
`disconnect` — disconnects interruption of the effect from its parent. This allows "early interruption" without waiting for finalization. It replaces the need for all `xyzFork` variants, which are now deprecated. It's quite useful with `race`, with or without `interruptible`.
`disown` — Called by a parent fiber to disown a child fiber. Relocates the child to the root set.

New ZIO.never

When `ZIO.never` is forked, it will be garbage collected, so `ZIO.never.onInterrupt(putStrLn("Bye"))` will never execute the finalizer. This can be inconvenient for testing, so `ZIO.infinity` is added which is like `never`, but won't be garbage collected.

Deletion of Daemon Mode

Daemon mode has been deleted because in practice, code never knows whether grandchildren should be daemons, only whether immediate children should be daemons; and generally, daemon mode is a one-off for a specific forked fiber.

In place of daemon mode, `effect.forkDaemon` can be used, which is the composition of two other operators: ordinary `fork`, followed by an immediate `disown` of the child fiber.

Deprecation of *Fork Variations

All `xyzFork` variants are deprecated or removed. For example, `bracketFork`. This is thanks to the new `disconnect` operator which allows for a much more compositional approach to solving this problem. Now if you don't want interruption of something to wait around for completion, just use `effect.disconnect`.

Performance enhancements for blocking effects

Blocking effects has seen several enhancement regarding performance, with potential change in semantic:
- Now, calling `lock` on a fiber first checks to see if the fiber is already on the correct Executor and does nothing if in that case;
- `effectBlocking` doesn’t interrupt the underlying thread anymore in case of fiber interruption. If you want to revert to previous behavior, use `effectBlockingInterrupt`.
- `Blocking` executor ergonomics were updated to enhance thread reuse and limit risk to crash the server in case of massive thread leak.

ZIO General API

Laziness

Effect constructors are now lazy. This is done to ensure that if users embed side-effects in unexpected places, then errors are managed by ZIO.

Deprecated traverse/sequence

Rather than have duplicate names for operators, the decision was made to deprecate the "classic names" for traverse/sequence, in favor of friendlier and more descriptive names foreach/collectAll.

ZIO Test

Inheritance Based Specs

Spes are now defined by inheriting from `DefaultRunnableSpec` instead of using constructor arguments:

scala
object ExampleSpec extends DefaultRunnableSpec {

def spec = suite(“ExampleSpec)(
test(“addition works”) {
assert(1 + 1)(equalTo(2))
}
)
}


This provides a more natural syntax for writing tests and allows defining data or helper methods in the same object instead of requiring a separate utility object.

Type Safe Equality

To provide increased type safety, the syntax for assertions has changed from `assert(1 + 1, equalTo(2))` to `assert(1 + 1)(equalTo(2))`. This curried syntax allows the test framework to issue a compilation error if an equality assertion is comparing two unrelated types, catching bugs earlier. A ScalaFix migration rule is provided to automatically rewrite assertions to the new curried syntax.

Improved Test Console Behavior

To facilitate debugging, by default the `TestConsole` will now render output to the standard output in addition to writing it to the output buffer. This feature is configurable on a scoped basis using the `debug` and `silent` methods on `TestConsole` or the corresponding test aspects.

Test Annotations

Test annotations provide flexible information for reporting metadata about tests. ZIO Test ships with a variety of test annotations that will automatically track metrics such as the number of ignored tests, the number of times a test was retried using `flaky` and the number of times a test was repeated using `nonFlaky`. Users can apply additional annotations using test aspects, for example timing the execution of tests and showing the slowest tests using `timed` or labeling tests with `tag`.

In the future test annotations will be the basis for additional structured test reporting to support rich analysis of test results both across suites and over time.

Spy Mocking Functionality

The `mock` package contains new functionality for spy mocks in the `Spyable` trait. Spies have the ability to wrap an existing service and capture all method calls to the service being spied on as well as inputs and outputs, making it easy to verify the behavior of elements of complex systems. See the Scaladoc for additional information on this new feature.

Providing The Environment

The functionality provided by layers discussed above makes it much for users to provide tests with additional environmental requirements. In particular, the `provideCustomLayer` and `provideCustomLayerShared` methods make it extremely easy to add an additional dependency to the `TestEnvironment`, which previously required significant boilerplate.

New Aspects

A variety of new test aspects have been added to provide more flexibility than ever in modifying test execution:

- `debug` — Renders `TestConsole` output to standard output for the scope of a test.
- `diagnose` — Runs a test on its own fiber and performs a fiber dump of the test fiber and all of its children if the test does not complete within the specified time. This can be extremely useful for diagnosing concurrency bugs.
- `forked` — Runs each test on its own fiber.
- `noDelay` — Automatically runs all effects involving the `TestClock` without it needing to be manually adjusted.
- `nonTermination` — Tests that an effect does not terminate within a specified time.
- `nondeterministic` — Runs each test with a random seed generated from the system time.
- `setSeed` — Sets the random seed for a test. This is useful to deterministically "replay" tests.
- `silent` — Prevents `TestConsole` output from being rendered to standard output for the scope of a test.
- `tag` — labels tests with the specified tag. Tests can be filtered based on tags and tags will be displayed along with test output.
- `verify` — Verifies that a postcondition holds after each test.

Additional Generator Combinators

A variety of additional combinators have been provided for composing generators. In particular, the `zip` variants allow composing multiple generators in parallel when the generators do not depend on each other. This allows for more efficient shrinking and can be particularly good for large case classes or similar data structure. Additional generators are also provided for types such as `java.util.UUID`.

**JUnit integration***

A custom JUnit runner is provided for running ZIO Test specs under other build tools (like Maven, Gradle, Bazel, etc.) and under IDEs.

To get the runner, add the equivalent of following dependency definition under your build tool:

scala
libraryDependencies ++= Seq(
"dev.zio" %% "zio-test-junit" % zioVersion % "test"
)


To make your spec appear as a JUnit test to build tools and IDEs, convert it to a class and annotate it with `RunWith(classOf[zio.test.junit.ZTestJUnitRunner])` or simply extend `zio.test.junit.JUnitRunnableSpec`.

Automatic Derivation of Generators Powered By Magnolia

Automatic derivation of generators for case classes and sealed traits is now available powered by Magnolia. To get it, add the following to your dependencies:

scala
libraryDependencies ++= Seq(
“dev.zio” %% “zio-test-magnolia” %% zioVersion % “test
)


You can then automatically derive generators for your own data types:

scala
final case class Person(name: String, age: Int)

val genPerson: Gen[Random with Sized, Person] = DeriveGen[Person]

sealed trait Color
case object Red extends Color
case object Green extends Color
case object Blue extends Color

val genColor: Gen[Random with Sized, Color] = DeriveGen[Color]


Experimental Polymorphic Generators

ZIO Test now includes experimental support for polymorphic generators. These generators do not require the user to specify a particular type but instead generate random data from a variety of types that satisfy specified constraints, such as having an `Ordering`. This can be useful for testing highly polymorphic code in a generic way. See the examples in the `zio.test.poly` package and please provide feedback on this feature.

ZIO Streams

ZIO Streams includes a number of new combinators, which can be explored through the Scaladoc, but no significant breaking changes were introduced.

ZIO STM

ZIO STM has undergone a large amount of development work, adding more power, more safety, and more structures.

More Methods

STM now features many more methods, which mirror those on ZIO structures; and STM structures like TArray now have many more useful methods on them.

Stack Safety

STM is now stack safe and can handle transactions of any size without stack overflows. This is achieved not with trampolining but by using exceptions for control-flow. There is a performance hit but it is minimal for the added stack safety.

Environment

STM itself has been generalized to ZSTM, permitting use of ZIO Environment. This is useful to embed STM structures directly into the environment, which allows transactions to operate against application-wide data structures, such as caches, counters, and the like.

New Structures

- `TMap`
- `TQueue`
- `TReentrantLock`

Contributors

There were a total of 67 contributors to RC18.

Thank you to Adam Fraser, Ajay Chandran, Alex Savin, Alexander van Olst, Bojan Babić, Bojan Blagojević, Boris V.Kuznetsov, Chris Andre, dariusrobson, Dejan Mijić, Dmitry Karlinsky, Dragutin Marjanović, Evgeny Veretennikov, Fabio Serragnoli, felher, Ferdinand Svehla, Greg Holland, Ievgen Garkusha, Igal Tabachnik, ioleo, Isaias Bartelborth, Itamar Ravid, Jan Toebes, Jens Hoffmann, John A. De Goes, Jonathan Winandy, Kai, Koleman Nix, Laurynas Lubys, Luis Miguel Mejía Suárez, Marek Kadek, Mateusz Sokół‚, Matthias Langer, Maxim Davydov, Maxim Schuwalow, montrivo, Nadav Samet, Oleksandra Holubitska, Oliver Wickham, Pascal Mengelt, Pavel Shirshov, Pavels Sisojevs, Paweł Kiersznowski, peterlopen, Philippe Derome, Pierangelo Cecchetto, Pierre Ricadat, Rafael Saraiva Figueiredo, Regis Kuckaertz, reibitto, Richard Whaling, Roberto Leibman, Salar Rahmanian, Sergey Rublev, simpadjo, sken, svroonland, TapanVaishnav, Tibor Erdesz, Unclebob, Vasil Vasilev, Vasiliy Levykin, Vitalii, Wiem Zine El Abidine, wongelz, and Zachary Albia for your contributions to ZIO.

It is our incredible community of users and contributors that make ZIO possible.

1.0.0rc17

Notable changes

This release contains major changes related to how fiber supervision is working.
The new behavior is that **a fiber will automatically be interrupted when its parent fiber is interrupted**. To make forked fibers independent of their parents, use **`.daemon`**.
Previously existing `interruptChildren`, `supervised`, `unsupervised`, `checkSupervised`, `superviseStatus` have been removed in favor of `daemon`, `nonDaemon`, `checkDaemon` and `daemonStatus`.

ZIO
- Complete overhaul of supervision (2169) by jdegoes
- Add fiber dumps with pretty printing for easier diagnostics (2228) by jdegoes
- Add a new implicit instance `CanFail[E]` which provides implicit evidence that an effect with an error type E can fail, that is that E is not equal to Nothing. Requires such evidence to exist for ZIO combinators such as orElse that only make sense if an effect can fail (2049) by adamgfraser
- Similarly, implements `NeedsEnv` so that useless combinators involving effects that don't require an environment don't compile (2065) by adamgfraser
- Add `ZIO.fromFunctionFuture` (1961) by jczuchnowski
- `effectAsync` should not resume fiber twice after interruption (1939) by darl
- Add `withFilter` (2114) by wi101
- Use `URIO` in type signatures where possible (2092) by joroKr21
- Add `ZIOdoUntil` and `ZIOdoWhile` (2147) by adamgfraser
- `Ignore` should not recover from unchecked exceptions (2148) by alexvanolst
- Reimplement `RaceWith` in the ZIO runloop for better performance (2091) by YuvalItzchakov
- Adapt `ZIO.someOrFailException` to improve interop with error types (2087) by mlangc
- Fix `Cause` Definition of Equals and HashCode (2220) by adamgfraser
- Improve implementation of `InterruptStatusisInterruptible` (2188) by sirthias

ZIO Stream
- Add `ZStreamChunkmapError` (2064) by vasilmkd
- Add missing `extends Serializable` to ZStream codebase (2063) by vasilmkd
- Make `ZStream.empty`, `ZStream.fail`, `ZStream.effectAsync` and others safe to pull again (2051 2139 2189 2197 2198 2199 2227) by vasilmkd
- Add `ZSink.fromFunctionM` (2112) by regiskuckaertz
- Add `ZStreamcollectM`, `collectWhileM` (2094) by saraiva132
- Make `ZStreamchunkN` return an instance of `ZStreamChunk` (2125) by saraiva132
- Rename `transduce`, `aggregate` and `aggregateWithin` to `aggregate`, `aggregateAsync` and `aggregateAsyncWithin` (2099) by simpadjo
- Add new shorthands for running ZStream: `runHead` and `runLast` (2113) by alexvanolst
- Add `access` and `accessM` to ZStream (2249) by pk044
- Add more `ZStreamdistributed` based combinators (2157) by mschuwalow

ZIO Test
- Add a new assertion `compile ` that requires the specified string to be valid Scala code (2215) by adamgfraser
- Make Companion Objects of Test Environments Serializable (2067) by adamgfraser
- Implement `TestClocksetDateTime` (2072) by adamgfraser
- Implement `Genlong` (2132) by adamgfraser
- Implement Overloaded Version of `TestAspectnonFlaky` (2140) by adamgfraser
- Implement `Except` Variants of Test Aspects (2146) by adamgfraser
- Adding `hasFirst`, `hasLast` and `hasAt` assertions (2156) by 13h3r
- Refactor `ZSpec` to Move All Test Failures to Error Channel (2145) by adamgfraser
- Limit number of runs when using `flaky` (2170) by adamgfraser
- Implement `TestAspectnonFlakyPar` (2176) by adamgfraser
- Fix Type Inference Issue in `checkM` Variants (2175) by adamgfraser
- Fix Naming Conflict with `TestAspectignore` (2184) by adamgfraser
- Suspend Effects in `testM` (2190) by adamgfraser
- Implement Warnings for Test Clock (2191) by adamgfraser
- Move Check Variants Back Into Package Object (2181) by adamgfraser
- Improvements to `provideManagedShared` (2192) by adamgfraser
- Support Labeled Assertions (2200) by adamgfraser
- Prevent Spurious TestClock Warnings (2210) by adamgfraser
- Remove Creation of New Runtimes (2213) by adamgfraser
- New Test Aspect `only` that when applied on a suite will ignore all tests that don't have the given substring in their label (1838) by dkarlinsky
- Fix Bug in `GenalphaNumericChar` (2233) by adamgfraser
- Improve Order of Parameters in `checkSome` (2224) by adamgfraser
- Fix Type Inference Issue With `TestAspectretry` (2218) by adamgfraser
- Add generators for time datatypes (2173) by dieproht

STM
- Add `TMap.merge` (2097) by regiskuckaertz
- Remove notion of immutability from TArray (2111) by Stefanqn
- Make `TArray` factories return STM (2141) by smart-ass
- Support keys with negative hashCodes in `TMap` (2203) by laurynasl-wix

Schedule
- Rename `ZSchedule` to `Schedule` (2242) by adamgfraser
- Rename `logInput`/ `logOutput` to `tapInput` / `tapOutput` (2050) by mschuwalow
- Improve `onDecision` signature (2089) by YuvalItzchakov

ZManaged
- Make parts of `ZManaged` private (2124) by stkeky
- Add `asError`, `catchAllCause`, `catchSomeCause`, `collect, `collectM` (2135 2137 2149) by dkarlinsky
- Add `sandboxWith`, `eventually` (2151 2161) by saraiva132
- Add `allocated` (2158) by mschuwalow
- Add `absorb` and `absorbWith` (2116) by alexvanolst
- Add `ZManaged.memoize` (2016) by mlangc

Chunk
- In `ChunkflatMap`, construct result array from the back (2165) by vasilmkd
- Add `collectM`, `collectWhileM` combinators (2150) by saraiva132
- Fix `Chunk.size` that was always returning 0 (2217) by ajaychandran

Semaphore
- Deprecate `acquire`, `acquireN`, `release`, `releaseN` in favor of `withPermits` (1523) by adamgfraser

Duration
- Use `toMillis` for java infinity duration (2209) by TapanVaishnav

1.0.0rc16

Notable changes

ZIO

* Refactor Schedule's encoding to accurately reflect required environment (1798) by mschuwalow
* Add ZManaged.makeInterruptible (2046) by neko-kai
* Make Fiber Composition Parallel (2038) by adamgfraser
* Add TSet (2029) by mijicd
* Add TMap (2017) by mijicd
* Make CausefoldLeft Stack Safe (1990) by adamgfraser
* Add ZManaged aliases (1999) by ioleo

ZIO Stream

* Add ChunkmapAccumM and ZStreamChunkmapAccumM (2041) by vasilmkd
* Implement ZSinktapInput and ZSinktapOutput (2044) by adamgfraser
* Add `ZSink.splitOn` (2006) by regiskuckaertz
* Add error handling combinators to ZStreamChunk (2002) by vasilmkd
* Properly name ZStreammapConcat* combinators (2012) by vasilmkd
* Add ZStreamChunkprovide combinators (2015) by vasilmkd
* Add ZStreamChunkensuring and ZStreamChunkensuringFirst (2010) by vasilmkd
* Add ChunkfilterM and ZStreamChunkfilterM (2011) by vasilmkd
* Correct the type signature for `zio.stream.ZSinkoptional` (1988) by gerdreiss
* Add dropUntil and takeUntil to ZStreamChunk (1982) by vasilmkd

ZIO Test

In this release, the mocking framework API has gone through complete overhaul to be more concise and feature better type inference. Notable changes:
- The capability tags for default mock services are moved directly to modules companion object. Use `MockClock.nanoTime` instead of `MockClock.Service.nanoTime`;
- The expectations are now methods on capability tags. Use `MockRandom.nextInt._0(equalTo(1)) returns value(42)` instead of `MockSpec.expect_(MockRandom.Service.nextInt._0)(equalTo(1))(42)`;
- Assertions for input are now passed as arguments, e.g. `MockConsole.putStrLn(equalTo("foo")) returns unit`;
- Stubbing returns is done via static methods `value`, `valueF`, `valueM`, `failure`, `failureF`, `failureM`, `unit`, and `never` in `zio.test.mock.Expectation`;
- Dummy services (expecting no calls) are constructed using a static method `nothing` from `zio.test.mock.Expectation`. For example, `val dummyConsole = Expectation.nothing[MockConsole]`;
- The conversion to managed mock service is automatic and does not require any imports or type hints.

For more examples, see [MockingExampleSpec](https://github.com/zio/zio/blob/v1.0.0-RC16/examples/shared/src/test/scala/zio/examples/test/MockingExampleSpec.scala).

Additional changes:
* Make flaky retry tests that die (2045) by adamgfraser
* Implement decorators for test environment (2043) by adamgfraser
* Add Expectation.nothing (2042) by ioleo
* Add assertCompletes (2035) by adamgfraser
* Refactor FailureDetails to report the entire error hierarchy (1985) by adamgfraser
* Implement TestAspectifEnv (1962) by adamgfraser
* Add suite selection and support multiple terms (2014) by reibitto
* Overhaul the mocking framework (2000) by ioleo

1.0.0rc15

Notable changes

Build

ZIO, ZIO Test and ZIO Streams are now published for Dotty. This release builds against Dotty 0.19.

ZIO

* Make `ZIOasError` argument by-name to match `ZIOas` by neko-kai (1905)
* Rename `ChunknotEmpty` to `nonEmpty`, add `Chunksize` by iravid (1913)
* Add `ZEnv` - a convenient definition for the standard ZIO environment by mschuwalow (1915)
* Add mapping functions for `ZEnv`'s components by mschuwalow (1957)
* Add `PromisecompleteWith` and memoize the IO passed to `Promisecomplete` (*semantics have changed here* - take note if using `Promisecomplete`) by adamgfraser (1954)
* Reduce spurious FiberFailure warnings in built-in combinators by adamgfraser (1949)

ZIO Test

* Display a summary of failed and ignored tests by kapke (1786)
* Improve the inference for `AssertionequalTo` by adamgfraser (1946)

ZIO Streams

* Add `Stream.bracketExit` by vasilmkd (1950)
* Add `ChunkcollectWhile`, `ZStreamChunkcollectWhile` by vasilmkd (1945)
* Eliminate space leaks with streams that concatenate infinitely (for example - `ZStream.repeat`) by iravid (1952)

Page 12 of 20

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.