Skip to content

Commit

Permalink
11.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Mar 1, 2025
1 parent 6aa41bb commit 64b7e1e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ inThisBuild(
Seq(
scalaVersion := "3.6.3",
versionScheme := Some("early-semver"),
version := "11.6.2",
version := "11.7.0",
organization := "org.lichess",
licenses += ("MIT" -> url("https://opensource.org/licenses/MIT")),
publishTo := Option(Resolver.file("file", new File(sys.props.getOrElse("publishTo", ""))))
Expand Down
9 changes: 5 additions & 4 deletions lila/src/main/scala/Bus.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import scala.jdk.CollectionConverters.*
import scala.reflect.Typeable
import scala.concurrent.duration.*
import scala.concurrent.{ ExecutionContext, Future, Promise }
import com.github.benmanes.caffeine.cache.Scheduler
import scalalib.future.extensions.withTimeout
import scalalib.future.FutureAfter

Expand Down Expand Up @@ -34,6 +33,10 @@ object Bus:
type Payload = Matchable
type SubscriberFunction = PartialFunction[Payload, Unit]

final class Bus(initialCapacity: Int = 4096):

import Bus.*

def pub[T <: Payload](payload: T)(using wc: WithChannel[T]) =
publish(payload, wc.channel)

Expand Down Expand Up @@ -66,7 +69,6 @@ object Bus:

def ask[A](channel: Channel, timeout: FiniteDuration = 2.second)(makeMsg: Promise[A] => Matchable)(using
ExecutionContext,
Scheduler,
FutureAfter
): Future[A] =
val promise = Promise[A]()
Expand All @@ -78,7 +80,6 @@ object Bus:
wc: WithChannel[T]
)(using
ExecutionContext,
Scheduler,
FutureAfter
): Future[A] =
val promise = Promise[A]()
Expand All @@ -88,7 +89,7 @@ object Bus:
promise.future.withTimeout(timeout, s"Bus.safeAsk $channel $msg")

private val bus = EventBus[Payload, Channel, Tellable](
initialCapacity = 4096,
initialCapacity = initialCapacity,
publish = (tellable, event) => tellable ! event
)

Expand Down

0 comments on commit 64b7e1e

Please sign in to comment.