From 403984394454cdd4c2288c1964ab9d545139988c Mon Sep 17 00:00:00 2001 From: Jules Ivanic Date: Sun, 9 Feb 2025 13:03:39 +1100 Subject: [PATCH 1/2] Remove community project `zio-aws-s3` from doc as it's not maintained Last commit was 5y ago See https://github.com/zio-mesh/zio-aws-s3 --- docs/ecosystem/community/zio-aws-s3.md | 47 -------------------------- website/sidebars.js | 1 - 2 files changed, 48 deletions(-) delete mode 100644 docs/ecosystem/community/zio-aws-s3.md diff --git a/docs/ecosystem/community/zio-aws-s3.md b/docs/ecosystem/community/zio-aws-s3.md deleted file mode 100644 index 284bba55529d..000000000000 --- a/docs/ecosystem/community/zio-aws-s3.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -id: zio-aws-s3 -title: "ZIO AWS S3" ---- - -[ZIO AWS S3](https://github.com/zio-mesh/zio-aws-s3) is a ZIO integration with AWS S3 SDK. - -## Introduction - -This project aims to ease ZIO integration with AWS S3, providing a clean, simple and efficient API. - -## Installation - -In order to use this library, we need to add the following line in our `build.sbt` file: - -```scala -libraryDependencies += "io.github.neurodyne" %% "zio-aws-s3" % "0.4.13" -``` - -## Example - -```scala -import software.amazon.awssdk.regions.Region -import software.amazon.awssdk.services.s3.S3AsyncClient -import zio.{ExitCode, URIO, _} -import zio_aws_s3.AwsApp.AwsLink -import zio_aws_s3.{AwsAgent, AwsApp} - -import scala.jdk.CollectionConverters._ - -object ZIOAWSS3Example extends zio.App { - val BUCKET = "" - - val awsEnv: ZLayer[S3AsyncClient, Throwable, AwsLink] = - AwsApp.ExtLayer.live >>> AwsApp.AwsLink.live - - val app: ZIO[Any, Throwable, Unit] = for { - s3 <- AwsAgent.createClient(Region.US_WEST_2, "") - response <- AwsApp.listBuckets().provide(awsEnv).provideEnvironment(s3) - buckets <- Task(response.buckets.asScala.toList.map(_.name)) - _ = buckets.foreach(println) - } yield () - - override def run(args: List[String]): URIO[zio.ZEnv, ExitCode] = - app.exitCode -} -``` diff --git a/website/sidebars.js b/website/sidebars.js index bd00e398fde5..0c4f8bd347b6 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -557,7 +557,6 @@ module.exports = { "ecosystem/community/zio-amqp", "ecosystem/community/zio-apache-parquet", "ecosystem/community/zio-arrow", - "ecosystem/community/zio-aws-s3", "ecosystem/community/zio-grpc", "ecosystem/community/zio-k8s", "ecosystem/community/zio-kinesis", From 49f6afb757cd4252915f3f48a572a0c1ce163d31 Mon Sep 17 00:00:00 2001 From: Jules Ivanic Date: Sun, 9 Feb 2025 14:26:45 +1100 Subject: [PATCH 2/2] Remove community project `zio-arrow` and `zio-saga` from doc as it's not maintained Last commit was 5y ago See https://github.com/zio-mesh/zio-aws-s3 --- build.sbt | 3 - docs/ecosystem/community/zio-arrow.md | 80 --------------------------- docs/ecosystem/community/zio-saga.md | 56 ------------------- website/sidebars.js | 2 - 4 files changed, 141 deletions(-) delete mode 100644 docs/ecosystem/community/zio-arrow.md delete mode 100644 docs/ecosystem/community/zio-saga.md diff --git a/build.sbt b/build.sbt index 8e0e822814a4..1483112024f6 100644 --- a/build.sbt +++ b/build.sbt @@ -867,17 +867,14 @@ lazy val docs = project.module "com.github.poslegm" %% "munit-zio" % "0.3.0", "nl.vroste" %% "rezilience" % "0.10.3", "io.github.gaelrenoux" %% "tranzactio" % "4.2.0", - "io.github.neurodyne" %% "zio-arrow" % "0.2.1", "nl.vroste" %% "zio-amqp" % "0.5.0", // "dev.zio" %% "zio-aws-core" % "5.17.102.7", // "dev.zio" %% "zio-aws-ec2" % "5.17.102.7", // "dev.zio" %% "zio-aws-elasticbeanstalk" % "5.17.102.7", // "dev.zio" %% "zio-aws-netty" % "5.17.102.7", - "io.github.neurodyne" %% "zio-aws-s3" % "0.4.13", "com.coralogix" %% "zio-k8s-client" % "3.1.0", "com.softwaremill.sttp.client3" %% "async-http-client-backend-zio" % "3.10.1", "nl.vroste" %% "zio-kinesis" % "0.35.0", - "com.vladkopanev" %% "zio-saga-core" % "0.6.0", "io.scalac" %% "zio-slick-interop" % "0.6.0", "com.typesafe.slick" %% "slick-hikaricp" % "3.5.2", "info.senia" %% "zio-test-akka-http" % "2.0.14", diff --git a/docs/ecosystem/community/zio-arrow.md b/docs/ecosystem/community/zio-arrow.md deleted file mode 100644 index 428bc1aaf3a0..000000000000 --- a/docs/ecosystem/community/zio-arrow.md +++ /dev/null @@ -1,80 +0,0 @@ ---- -id: zio-arrow -title: "ZIO Arrow" ---- - -[ZIO Arrow](https://github.com/zio-mesh/zio-arrow/) provides the `ZArrow` effect, which is a high-performance composition effect for the ZIO ecosystem. - -## Introduction - -`ZArrow[E, A, B]` is an effect representing a computation parametrized over the input (`A`), and the output (`B`) that may fail with an `E`. Arrows focus on **composition** and **high-performance computation**. They are like simple functions, but they are lifted into the `ZArrow` context. - -`ZArrow` delivers three main capabilities: - -- ** High-Performance** — `ZArrow` exploits `JVM` internals to dramatically decrease the number of allocations and dispatches, yielding an unprecedented runtime performance. - -- **Abstract interface** — `Arrow` is a more abstract data type, than ZIO Monad. It's more abstract than ZIO Streams. In a nutshell, `ZArrow` allows a function-like interface that can have both different inputs and different outputs. - -- **Easy Integration** — `ZArrow` can both input and output `ZIO Monad` and `ZIO Stream`, simplifying application development with different ZIO Effect types. - -## Installation - -In order to use this library, we need to add the following line in our `build.sbt` file: - -```scala -libraryDependencies += "io.github.neurodyne" %% "zio-arrow" % "0.2.1" -``` - -## Example - -In this example we are going to write a repetitive task of reading a number from standard input and then power by 2 and then print the result: - -```scala -import zio.arrow.ZArrow -import zio.arrow.ZArrow._ -import zio.console._ -import zio.{ExitCode, URIO} - -import java.io.IOException - -object ArrowExample extends zio.App { - - val isPositive : ZArrow[Nothing, Int, Boolean] = ZArrow((_: Int) > 0) - val toStr : ZArrow[Nothing, Any, String] = ZArrow((i: Any) => i.toString) - val toInt : ZArrow[Nothing, String, Int] = ZArrow((i: String) => i.toInt) - val getLine : ZArrow[IOException, Any, String] = ZArrow.liftM((_: Any) => getStrLn.provide(Console.live)) - val printStr : ZArrow[IOException, String, Unit] = ZArrow.liftM((line: String) => putStr(line).provide(Console.live)) - val printLine : ZArrow[IOException, String, Unit] = ZArrow.liftM((line: String) => putStrLn(line).provide(Console.live)) - val power2 : ZArrow[Nothing, Int, Double] = ZArrow((i: Int) => Math.pow(i, 2)) - val enterNumber: ZArrow[Nothing, Unit, String] = ZArrow((_: Unit) => "Enter positive number (-1 to exit): ") - val goodbye : ZArrow[Nothing, Any, String] = ZArrow((_: Any) => "Goodbye!") - - val app: ZArrow[IOException, Unit, Boolean] = - enterNumber >>> printStr >>> getLine >>> toInt >>> - ifThenElse(isPositive)( - power2 >>> toStr >>> printLine >>> ZArrow((_: Any) => true) - )( - ZArrow((_: Any) => false) - ) - - val myApp = whileDo(app)(ZArrow(_ => ())) >>> goodbye >>> printLine - - override def run(args: List[String]): URIO[zio.ZEnv, ExitCode] = - myApp.run(()).exitCode -} -``` - -Let's see an example of running this program: - -``` -Enter positive number (-1 to exit): 25 -625.0 -Enter positive number (-1 to exit): 8 -64.0 -Enter positive number (-1 to exit): -1 -Goodbye! -``` - -## Resources - -- [Blazing Fast, Pure Effects without Monads](https://www.youtube.com/watch?v=L8AEj6IRNEE) by John De Goes (Dec 2018) diff --git a/docs/ecosystem/community/zio-saga.md b/docs/ecosystem/community/zio-saga.md deleted file mode 100644 index 9298ae02f615..000000000000 --- a/docs/ecosystem/community/zio-saga.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -id: zio-saga -title: "ZIO Saga" ---- - -[ZIO Saga](https://github.com/VladKopanev/zio-saga) is a distributed transaction manager using Saga Pattern. - -## Introduction - -Sometimes when we are architecting the business logic using microservice architecture we need distributed transactions that are across services. - -The _Saga Pattern_ lets us manage distributed transactions by sequencing local transactions with their corresponding compensating actions. A _Saga Pattern_ runs all operations. In the case of failure, it guarantees us to undo all previous works by running the compensating actions. - -ZIO Saga allows us to compose our requests and compensating actions from the Saga pattern in one transaction with no boilerplate. - -ZIO Saga adds a simple abstraction called `Saga` that takes the responsibility of proper composition of effects and associated compensating actions. - -## Installation - -In order to use this library, we need to add the following line in our `build.sbt` file: - -```scala -libraryDependencies += "com.vladkopanev" %% "zio-saga-core" % "0.4.0" -``` - -## Example - -In the following example, all API requests have a compensating action. We compose all them together and then run the whole as one transaction: - -```scala -import zio.{IO, UIO, URIO, ZIO} -def bookHotel: UIO[Unit] = IO.unit -def cancelHotel: UIO[Unit] = IO.unit - -def bookTaxi: IO[String, Unit] = IO.unit -def cancelTaxi: IO[String, Unit] = IO.unit - -def bookFlight: IO[String, Unit] = IO.unit -def cancelFlight: IO[String, Unit] = IO.unit -``` - -```scala -import com.vladkopanev.zio.saga.Saga -import zio.{IO, UIO, URIO, ZIO} - -import com.vladkopanev.zio.saga.Saga._ - -val transaction: Saga[Any, String, Unit] = - for { - _ <- bookHotel compensate cancelHotel - _ <- bookTaxi compensate cancelTaxi - _ <- bookFlight compensate cancelFlight - } yield () - -val myApp: ZIO[Any, String, Unit] = transaction.transact -``` diff --git a/website/sidebars.js b/website/sidebars.js index 0c4f8bd347b6..3f994412009d 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -556,13 +556,11 @@ module.exports = { "ecosystem/community/tranzactio", "ecosystem/community/zio-amqp", "ecosystem/community/zio-apache-parquet", - "ecosystem/community/zio-arrow", "ecosystem/community/zio-grpc", "ecosystem/community/zio-k8s", "ecosystem/community/zio-kinesis", "ecosystem/community/zio-nebula", "ecosystem/community/zio-pulsar", - "ecosystem/community/zio-saga", "ecosystem/community/zio-slick-interop", "ecosystem/community/zio-temporal", "ecosystem/community/zio-test-akka-http",