Skip to content

Commit

Permalink
seal PollingContext
Browse files Browse the repository at this point in the history
  • Loading branch information
armanbilge committed Oct 27, 2024
1 parent 26ef827 commit c125e73
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 @@ -104,7 +104,7 @@ abstract class PollingSystem {

}

trait PollingContext[P] {
sealed trait PollingContext[P] {

/**
* Register a callback to obtain a thread-local `Poller`
Expand All @@ -119,6 +119,8 @@ trait PollingContext[P] {
def ownPoller(poller: P): Boolean
}

private[unsafe] trait UnsealedPollingContext[P] extends PollingContext[P]

object PollingSystem {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private[effect] final class WorkStealingThreadPool[P <: AnyRef](
reportFailure0: Throwable => Unit
) extends ExecutionContextExecutor
with Scheduler
with PollingContext[P] {
with UnsealedPollingContext[P] {

import TracingConstants._
import WorkStealingThreadPoolConstants._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ private[unsafe] abstract class IORuntimeCompanionPlatform { this: IORuntime.type
val loop = new EventLoopExecutorScheduler[system.Poller](64, system)
val poller = loop.poller
val api = system.makeApi(
new PollingContext[system.Poller] {
new UnsealedPollingContext[system.Poller] {
def accessPoller(cb: system.Poller => Unit) = cb(poller)
def ownPoller(poller: system.Poller) = true
}
Expand Down

0 comments on commit c125e73

Please sign in to comment.