akka/akka-core

Error with Akka Typed BehaviorTestKit while using TimerScheduler

Open

#24,686 opened on 2018年3月8日

GitHub で見る
 (3 comments) (1 reaction) (0 assignees)Scala (3,547 forks)batch import
1 - triagedhelp wantedt:typed

Repository metrics

Stars
 (13,277 stars)
PR merge metrics
 (平均マージ 8d 19h) (30d で 10 merged PRs)

説明

Trying to create a BehaviorTestKit using a behavior which spawns a timer within as given below

val behaviorTestKit = BehaviorTestKit(createBehavior)

private def createBehavior(): Behavior[MyMessage] = {
  Behaviors
    .withTimers[MyMessage](
      timerScheduler ⇒
        Behaviors
          .mutable[MyMessage](
            ctx =>
              new MyBehavior(
                ctx,
                timerScheduler,
                someInfo
            )
        )
    )
}

gives the following error:

An exception or error caused a run to abort: no scheduler 
java.lang.UnsupportedOperationException: no scheduler

It will be helpful if some stub implementation of scheduler could be supported like in case of contexts.

コントリビューターガイド