Skip to content

Commit

Permalink
Update all dependencies (#35)
Browse files Browse the repository at this point in the history
* Update all dependencies

* scalafmt updates
  • Loading branch information
softinio committed Jun 30, 2019
1 parent 6883d98 commit 77b2fe8
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 55 deletions.
31 changes: 8 additions & 23 deletions .scalafmt.conf
@@ -1,30 +1,15 @@
version = "2.0.0"
maxColumn = 120
align = most
continuationIndent.defnSite = 2
assumeStandardLibraryStripMargin = true
danglingParentheses = true
docstrings = JavaDoc
lineEndings = unix
maxColumn = 100

continuationIndent {
callSite = 2
defnSite = 2
}

newlines {
alwaysBeforeTopLevelStatements = true
alwaysBeforeMultilineDef = true
}

lineEndings = preserve
includeCurlyBraceInSelectChains = false
danglingParentheses = true
spaces {
afterKeywordBeforeParen = true
inImportCurlyBraces = true
}
optIn.annotationNewlines = true

rewrite.rules = [
AsciiSortImports,
AvoidInfix,
PreferCurlyFors,
RedundantBraces,
RedundantParens,
SortModifiers
]
rewrite.rules = [SortImports, RedundantBraces]
6 changes: 3 additions & 3 deletions build.sbt
Expand Up @@ -28,13 +28,13 @@ scmInfo := Some(
ScmInfo(url("https://github.com/zio/zio-actors/"), "scm:git:git@github.com:zio/zio-actors.git")
)

val scalazVersion = "7.2.26"
val scalazVersion = "7.2.28"
val testzVersion = "0.0.5"
val zioVersion = "0.19"
val zioVersion = "1.0.0-RC9"

libraryDependencies ++= Seq(
"org.scalaz" %% "scalaz-core" % scalazVersion,
"org.scalaz" %% "scalaz-zio" % zioVersion,
"dev.zio" %% "zio" % zioVersion,
"org.scalaz" %% "testz-stdlib" % testzVersion
)

Expand Down
8 changes: 4 additions & 4 deletions project/plugins.sbt
@@ -1,6 +1,6 @@
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "3.0.0")
addSbtPlugin("com.geirsson" % "sbt-scalafmt" % "1.6.0-RC3")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.3.3")
addSbtPlugin("com.47deg" % "sbt-microsites" % "0.8.0")
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.0.0")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.0.2")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.3.7")
addSbtPlugin("com.47deg" % "sbt-microsites" % "0.9.2")
addSbtPlugin("ch.epfl.scala" % "sbt-release-early" % "2.1.1")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1")
35 changes: 17 additions & 18 deletions src/main/scala/zio/actors/Actor.scala
@@ -1,8 +1,8 @@
package zio.actors

import scalaz.zio.{ IO, Promise, Queue, Ref }
import zio.{ IO, Promise, Queue, Ref }

trait Actor[+E, -F[+ _]] {
trait Actor[+E, -F[+_]] {
def ![A](fa: F[A]): IO[E, A]

def stop: IO[Nothing, List[_]]
Expand All @@ -11,11 +11,11 @@ trait Actor[+E, -F[+ _]] {
object Actor {
val DefaultActorMailboxSize = 10000

trait Stateful[S, +E, -F[+ _]] {
trait Stateful[S, +E, -F[+_]] {
def receive[A](state: S, msg: F[A]): IO[E, (S, A)]
}

final def stateful[S, E, F[+ _]](
final def stateful[S, E, F[+_]](
supervisor: Supervisor[E],
mailboxSize: Int = DefaultActorMailboxSize
)(initial: S)(
Expand Down Expand Up @@ -45,19 +45,18 @@ object Actor {
t <- queue.take
_ <- process(t, state)
} yield ()).forever.fork
} yield
new Actor[E, F] {
override def ![A](a: F[A]): IO[E, A] =
for {
promise <- Promise.make[E, A]
_ <- queue.offer((a, promise))
value <- promise.await
} yield value
override def stop: IO[Nothing, List[_]] =
for {
tall <- queue.takeAll
_ <- queue.shutdown
} yield tall
}
} yield new Actor[E, F] {
override def ![A](a: F[A]): IO[E, A] =
for {
promise <- Promise.make[E, A]
_ <- queue.offer((a, promise))
value <- promise.await
} yield value
override def stop: IO[Nothing, List[_]] =
for {
tall <- queue.takeAll
_ <- queue.shutdown
} yield tall
}
}
}
4 changes: 2 additions & 2 deletions src/main/scala/zio/actors/Supervisor.scala
@@ -1,7 +1,7 @@
package zio.actors

import scalaz.zio.{ IO, Schedule, ZIO }
import scalaz.zio.clock.Clock
import zio.{ IO, Schedule, ZIO }
import zio.clock.Clock

trait Supervisor[-E] {
def supervise[A](io: IO[E, A], error: E): IO[Unit, A]
Expand Down
10 changes: 5 additions & 5 deletions src/test/scala/zio/actors/ActorsSuite.scala
@@ -1,7 +1,7 @@
package zio.actors

import scalaz.zio.{ DefaultRuntime, IO, Ref, Schedule }
import testz.{ Harness, assert }
import zio.{ DefaultRuntime, IO, Ref, Schedule }
import testz.{ assert, Harness }
import zio.actors.Actor.Stateful

import java.util.concurrent.atomic.AtomicBoolean
Expand All @@ -13,7 +13,7 @@ final class ActorsSuite extends DefaultRuntime {

section(
test("Sequential message processing") { () =>
sealed trait Message[+ _]
sealed trait Message[+_]
case object Reset extends Message[Unit]
case object Increase extends Message[Unit]
case object Get extends Message[Int]
Expand All @@ -40,7 +40,7 @@ final class ActorsSuite extends DefaultRuntime {
assert(c1 == 2 && c2 == 0)
},
test("Error recovery by retrying") { () =>
sealed trait Message[+ _]
sealed trait Message[+_]
case object Tick extends Message[Unit]

val maxRetries = 10
Expand Down Expand Up @@ -71,7 +71,7 @@ final class ActorsSuite extends DefaultRuntime {
assert(unsafeRun(counter) == maxRetries)
},
test("Error recovery by fallback action") { () =>
sealed trait Message[+ _]
sealed trait Message[+_]
case object Tick extends Message[Unit]

val handler = new Stateful[Unit, String, Message] {
Expand Down

0 comments on commit 77b2fe8

Please sign in to comment.