Skip to content

Commit

Permalink
Merge branch 'series/0.14'
Browse files Browse the repository at this point in the history
  • Loading branch information
rossabaker committed May 26, 2021
2 parents 92b23ab + 67db19e commit 1f43b95
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package org.http4s.blaze.util

import java.util.concurrent.atomic.AtomicReference

import scala.annotation.tailrec
import scala.util.control.NonFatal
import scala.concurrent.ExecutionContext
Expand Down Expand Up @@ -77,6 +76,8 @@ class TickWheelExecutor(wheelSize: Int = DefaultWheelSize, val tick: Duration =
def shutdown(): Unit =
alive = false

private[http4s] def isAlive = alive

/** Schedule the `Runnable` on the [[TickWheelExecutor]]
*
* Execution is performed on the [[TickWheelExecutor]]s thread, so only extremely small
Expand Down Expand Up @@ -127,7 +128,7 @@ class TickWheelExecutor(wheelSize: Int = DefaultWheelSize, val tick: Duration =
Cancelable.NoopCancel
}
}
else sys.error("TickWheelExecutor is shutdown")
else throw TickWheelExecutor.AlreadyShutdownException

// Deals with appending and removing tasks from the buckets
private def handleTasks(): Unit = {
Expand Down Expand Up @@ -273,6 +274,7 @@ class TickWheelExecutor(wheelSize: Int = DefaultWheelSize, val tick: Duration =
}

object TickWheelExecutor {
object AlreadyShutdownException extends RuntimeException("TickWheelExecutor is shutdown")

/** Default size of the hash wheel */
val DefaultWheelSize = 512
Expand Down

0 comments on commit 1f43b95

Please sign in to comment.