Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Releases: zio/zio

2.0.0-M2

21 Aug 03:24

Choose a tag to compare

This next milestone release contains bug fixes and performance improvements., bringing us one step closer to the first release candidate for ZIO 2.0. Please let us know your feedback!

1.0.11

21 Aug 03:24
958a83c

Choose a tag to compare

This minor release contains big fixes and various improvements. In particular, ZLayer#flatMap has now been implemented to make it easier to build layers dynamically based on inputs such as configuration information. Smart assertions get better with improved diffing and more accurate source locations thanks to work by @kitlangton. And @khajavi has continued his work of building out the website by adding documentation for ZIO ecosystem libraries.

As always, thank you for your continued support.

ZIO Core

ZIO Stream

ZIO Test

2.0.0-M1

27 Jul 15:02

Choose a tag to compare

We are excited to share with you the first milestone release of ZIO 2.0, the next generation of concurrent programming in Scala.
ZIO 2.0 is the culmination of years of work by more than four hundred contributors and changes the game in four key areas.

Performance

ZIO has always been laser-focused on performance and ZIO 2.0 is no exception. The core runtime system has been hand-optimized to eliminate unnecessary work, getting you as close to bare metal as possible, while still providing the guarantees you have come to expect. This includes a new optimized interpreter for short, synchronous workloads to make it easy to run ZIO workflows in mixed applications without compromising performance.

ZIO 2.0 also features a new fiber-aware scheduler that automatically shifts work between underlying operating system threads to maximize fiber thread affinity, while using all the cores on your machine. This increases cache-locality and improves the performance of ZIO applications, without you having to do anything. With these changes, ZIO continues its history of bringing ZIO users leading performance.

Finally, ZIO 2.0 features optimized handling of blocking operations, avoiding unnecessary shifting between thread pools. Even if you write your code with many individual blocking operations, the ZIO runtime can eliminate most of these thread pool shifts. If you do blocking at a higher level, your code gets even faster.

ZIO.blocking {
  for {
    result1 <- ZIO.blocking(ZIO.attempt(doIO1()))
    result2 <- ZIO.blocking(ZIO.attempt(doIO2()))
    result3 <- ZIO.blocking(ZIO.attempt(doIO3()))
  } yield result1 + result2 + result3
}

Ergonomics

Ergonomics has always been a strong point for ZIO with its focus on concrete operators on concrete data types. And we're taking this to the next level in ZIO 2.0.

First, layers are getting easier to use. Layers have become the go-to solution for architecting large-scale applications, allowing teams to build functionality in a modular way with resource-safety, with more accessibility and less ramp-up time than alternative approaches. With the module pattern in ZIO 2.0, you can define services the way you would normal Java interfaces and implementation classes. Then you can wire them together with no boilerplate with built-in automatic layer construction, which is type-safe and happens at compile-time.

trait UserRepo {
  def getUserById(userId: UserId): Task[User]
}

final case class UserRepoRDBMS(database: Database) extends UserRepo {
  def getUserById(userId: UserId): Task[User] = ...
}

val userRepoDBMS = 
  (for {
    database <- ZIO.service[Database]
  } yield UserRepoRDMS(database)).toLayer
...
myApp.inject(UserRepoDBMS.live, MySqlDatabase.live, ...)

Second, the entire API has been polished and refined. Every operator describes what it does in as clear a way as possible. Instead of console.putStrLn think Console.printLine. Instead of ZIO.effect think ZIO.succeed. These changes make ZIO more accessible and enjoyable for developers of all backgrounds.

Third, we are introducing a new set of smart constructors that will automatically lift any data type into a ZIO, ZManaged, or ZStream. Don't remember the operator name for constructing a ZIO from an Either particular value? No problem, just use ZIO.from(either). This is particularly helpful for quickly getting new developers productive with ZIO.

ZIO.from {
  println("Entering example")
  for {
    result1 <- ZIO.from(Future.successful(1))
    result2 <- ZIO.from(Right(2))
    result3 <- ZIO.from(ZIO.from(3))
    result4 <- ZIO.from(Try(4))
  } yield result1 + result2 + result3 + result4
}

Operations

As more and more large organizations have adopted ZIO for mission critical applications, we have consistently heard the need for high quality, out-of-the-box solutions for logging, metrics, and tracing.

When ZIO 2.0 is released, it will have logging and metrics built-in, a first for any functional effect system in Scala. This will let you write an application and immediately have logging and metrics for free. Of course, you will also be able to plug in any existing logging or metrics system you are using and have it automatically work with ZIO.

Not yet available in this milestone release, ZIO 2.0 will also optimize execution tracing. ZIO pioneered execution traces for asynchronous code and we are building on this legacy by making execution traces even lower cost and even more useful, pointing directly to the section of user code that failed in the event of an error, and showing execution tracing in way that interfaces with existing debugging tooling.

Streaming

ZIO 2.0 is realizing the vision of what streams can be. Streaming has always been an extremely attractive paradigm for defining data flows in a compositional way, but for performance-sensitive applications that high level interface can turn into an obstacle when that streaming code is just too slow.

We believe that streams can be both principled and highly performant and we are making that a reality in ZIO 2.0 with a new encoding of streams based on the idea of conduits that fundamentally unifies streams and sinks. In this model, a conduit is essentially just a mutable asynchronous channel when it is run, much like the ones we might work with from the java.nio package. This lets us build all of the high level streaming abstractions from ZIO 1.0 while keeping that low level performance. It also gives users the flexibility to drop down to that lower level layer if necessary for implementing their own streaming operators.

This new vision of streams is backed up by optimized data structures. In particular, ZIO 2.0 features a highly optimized asynchronous message hub that is dramatically faster than equivalent data structures in other streaming libraries, supporting extremely fast broadcast operations. Data structures like hubs and queues give us the building blocks to implement many of these streaming operators in a highly performant way.


Thank you all for your support and we look forward to your feedback as we prepare for the final release of ZIO 2.0. For intrepid users who are aware of the costs of doing so, trying out an early release is extremely valuable to help us refine the changes we are making.
We expect to push quickly for an initial release candidate, with the goal of doing a final release of ZIO 2.0 in October assuming there have been no significant issues reported with the latest release candidate.

There has never been a more exciting time to be programming with Scala. We hope you enjoy using ZIO as much as we have developing it and can't wait to see what you build with it!

1.0.10

27 Jul 15:33
ec493b2

Choose a tag to compare

This minor release contains bug fixes and additional documentation. It also includes diffing for smart assertions.

ZIO Core

ZIO Stream

ZIO Test

1.0.9

02 Jun 04:12
c88d47c

Choose a tag to compare

In addition to various other improvements, this release introduces smart assertions for ZIO Test. Smart assertions allow you to make assertions about expected behavior using ordinary Scala expressions that return Boolean values instead of specialized assertion operators.

For example, instead of this:

assert(Option(3))(isSome(equalTo(2)))

You would do this:

assertTrue(Option(3).get == 2)

These expressions will automatically be translated to provide detailed messages pointing you to exactly what went wrong if a test does fail.

We are currently making smart assertions available through the assertTrue operator along with the existing assertions. However, we are considering replacing the existing assertions entirely with smart assertions in ZIO 2.0 (with an automated migration tool) so we would appreciate any feedback you have on this new feature.

Thanks to @kitlangton for his work on this as well as to @girishkolantra for his work on implementing the string diffing functionality that is included with the new smart assertions.

And as always thanks to all of you for your continued support!

ZIO Core

ZIO Stream

ZIO Test

1.0.8

18 May 02:24
b1a3621

Choose a tag to compare

This release contains support for Scala 3 on both the JVM and Scala.js platforms.

ZIO Core

ZIO Streams

ZIO Test

1.0.7

23 Apr 03:38
2147773

Choose a tag to compare

This release contains support for Scala 3.0.0-RC3. It is binary compatible with v1.0.0.

Notable changes

ZIO Core

ZIO Streams

ZIO Test

1.0.6

12 Apr 01:51
c50eb4f

Choose a tag to compare

This release brings support for Scala 3.0.0-RC2 as well as a variety of bug fixes and other improvements.

In particular, this is the first release to include features back ported from ZIO 2.0 with the addition of ZHub, a new concurrent data structure supporting extremely fast broadcast operations. ZHub now powers the broadcast operators in ZStream and the SubscriptionRef data type, as well as being available as a standalone data structure. Check out the documentation for additional information and please let us know what you think!

This release is binary compatible with v1.0.0.

Notable changes

ZIO Core

ZIO Streams

ZIO Test

1.0.5

09 Mar 13:28
02f2f72

Choose a tag to compare

This maintenance release contains support for Scala 3.0.0-RC1 as well as improved support for Scala Native and various bug fixes. This release is binary compatible with v1.0.0.

Notable changes

ZIO Core

ZIO Streams

  • Fix error swallowing in ZStream#repeat (#4681) (by @iravid)

ZIO Test

v1.0.4-2

02 Feb 21:49
1349610

Choose a tag to compare

This minor release contains a fix to a dependency issue regarding the SBT test runner for ZIO Test . Upgrading is recommended for all users. This release is binary compatible with v1.0.0.