Skip to content

Scala 2.13: ScalaRunnableWrapper uses akka.dispatch.Batchable #311

@iRevive

Description

@iRevive

Hello! Thanks for the awesome library.

I have a question regarding ScalaRunnableWrapper for Scala 2.13:

import akka.dispatch.Batchable
import akka.sensors.dispatch.DispatcherInstrumentationWrapper.Run
import scala.PartialFunction.condOpt
object ScalaRunnableWrapper {
def unapply(runnable: Runnable): Option[Run => Runnable] =
condOpt(runnable) {
case runnable: Batchable => new OverrideBatchable(runnable, _)
}
class OverrideBatchable(self: Runnable, r: Run) extends Batchable with Runnable {
def run(): Unit = r(() => self.run())
def isBatchable: Boolean = true

According to the code, the match expects the akka.dispatch.Batchable type. Then, AkkaRunnableWrapper relies on akka.dispatch.Batchable too.

case runnable: Batchable => new BatchableWrapper(runnable, _)

If I get it right, the case case ScalaRunnableWrapper(runnable) => runnable(r) will never happen.

def apply(runnableParam: Runnable, r: Run): Runnable =
runnableParam match {
case AkkaRunnableWrapper(runnable) => runnable(r)
case ScalaRunnableWrapper(runnable) => runnable(r)
case runnable => new Default(runnable, r)
}

I assume, ScalaRunnerWrapper should import scala.concurrent.Batchable instead?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions