Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions core/shared/src/main/scala/zio/IO.scala
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,12 @@ object IO {
*/
def effectTotal[A](effect: => A): UIO[A] = ZIO.effectTotal(effect)

/**
* @see See [[zio.ZIO.executor]]
*/
def executor: UIO[Executor] =
ZIO.executor

/**
* @see See [[zio.ZIO.fail]]
*/
Expand Down
6 changes: 6 additions & 0 deletions core/shared/src/main/scala/zio/RIO.scala
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,12 @@ object RIO {
*/
def environment[R]: URIO[R, R] = ZIO.environment

/**
* @see See [[zio.ZIO.executor]]
*/
def executor: UIO[Executor] =
ZIO.executor

/**
* @see See [[zio.ZIO.fail]]
*/
Expand Down
6 changes: 6 additions & 0 deletions core/shared/src/main/scala/zio/Task.scala
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,12 @@ object Task extends TaskPlatformSpecific {
*/
def effectTotal[A](effect: => A): UIO[A] = ZIO.effectTotal(effect)

/**
* @see See [[zio.ZIO.executor]]
*/
def executor: UIO[Executor] =
ZIO.executor

/**
* @see See [[zio.ZIO.fail]]
*/
Expand Down
6 changes: 6 additions & 0 deletions core/shared/src/main/scala/zio/UIO.scala
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,12 @@ object UIO {
*/
def effectSuspendTotalWith[A](p: (Platform, Fiber.Id) => UIO[A]): UIO[A] = ZIO.effectSuspendTotalWith(p)

/**
* @see See [[zio.ZIO.executor]]
*/
def executor: UIO[Executor] =
ZIO.executor

/**
* @see [[zio.ZIO.fiberId]]
*/
Expand Down
6 changes: 6 additions & 0 deletions core/shared/src/main/scala/zio/URIO.scala
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,12 @@ object URIO {
*/
def environment[R]: URIO[R, R] = ZIO.environment

/**
* @see See [[zio.ZIO.executor]]
*/
def executor: UIO[Executor] =
ZIO.executor

/**
* @see [[zio.ZIO.fiberId]]
*/
Expand Down
6 changes: 6 additions & 0 deletions core/shared/src/main/scala/zio/ZIO.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2672,6 +2672,12 @@ object ZIO extends ZIOCompanionPlatformSpecific {
*/
def environment[R]: URIO[R, R] = access(r => r)

/**
* Retrieves the executor for this effect.
*/
def executor: UIO[Executor] =
effectSuspendTotalWith((platform, _) => ZIO.succeedNow(platform.executor))

/**
* Returns an effect that models failure with the specified error.
* The moral equivalent of `throw` for pure code.
Expand Down