Created
May 22, 2021 16:44
-
-
Save natansil/4030b5c3722aa0f68448278ea42c8f01 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object FiberTracking { | |
type FiberTracking = Has[FiberTracking.Service] | |
trait Service { | |
def fibers: UIO[Chunk[Fiber.Runtime[Any, Any]]] | |
} | |
def fibers: URIO[FiberTracking, Chunk[Fiber.Runtime[Any, Any]]] = | |
ZIO.accessM(_.get.fibers) | |
def make(supervisor: Supervisor[Chunk[Fiber.Runtime[Any, Any]]]): FiberTracking = | |
Has(new Service { | |
override def fibers: UIO[Chunk[Fiber.Runtime[Any, Any]]] = supervisor.value | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment