Skip to content

Commit

Permalink
some compile issues
Browse files Browse the repository at this point in the history
  • Loading branch information
pjfanning committed Jan 30, 2025
1 parent 1e345b0 commit bf76e89
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ private[pekko] final class FunctionRef[-T](override val path: ActorPath, send: (
@InternalApi private[pekko] def internalSpawnMessageAdapter[U](f: U => T, name: String): ActorRef[U] = {

val n = if (name != "") s"${childName.next()}-$name" else childName.next()
val p = (path / n).withUid(rnd().nextInt())
val p = (path / n).withUid(RandomNumberGenerator.get().nextInt())
val i = new BehaviorTestKitImpl[U](system, p, BehaviorImpl.ignore)
_children += p.name -> i

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
package org.apache.pekko.pattern

import java.util.Optional
import java.util.concurrent.{ Callable, CompletionException, CompletionStage, CopyOnWriteArrayList, ThreadLocalRandom }
import java.util.concurrent.{ Callable, CompletionException, CompletionStage, CopyOnWriteArrayList }
import java.util.concurrent.atomic.{ AtomicBoolean, AtomicInteger, AtomicLong }
import java.util.function.BiFunction
import java.util.function.Consumer
Expand All @@ -32,7 +32,7 @@ import pekko.dispatch.ExecutionContexts.parasitic
import pekko.pattern.internal.{ CircuitBreakerNoopTelemetry, CircuitBreakerTelemetry }
import pekko.util.FutureConverters._
import pekko.util.JavaDurationConverters._
import pekko.util.Unsafe
import pekko.util.{ RandomNumberGenerator, Unsafe }

/**
* Companion object providing factory methods for Circuit Breaker which runs callbacks in caller's thread
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import java.util.concurrent.ThreadLocalRandom
private[pekko] trait RandomNumberGenerator {
def nextInt(): Int
def nextInt(n: Int): Int
def nextInt(origin: Int, n: Int): Int
def nextLong(): Long
def nextDouble(): Double
}
Expand All @@ -34,6 +35,7 @@ private[pekko] trait RandomNumberGenerator {
private[pekko] object ThreadLocalRandomNumberGenerator extends RandomNumberGenerator {
override def nextInt(): Int = ThreadLocalRandom.current().nextInt()
override def nextInt(bound: Int): Int = ThreadLocalRandom.current().nextInt(bound)
override def nextInt(origin: Int, bound: Int): Int = ThreadLocalRandom.current().nextInt(origin, bound)
override def nextLong(): Long = ThreadLocalRandom.current().nextLong()
override def nextDouble(): Double = ThreadLocalRandom.current().nextDouble()
}
Expand Down

0 comments on commit bf76e89

Please sign in to comment.