Trait

polynote.kernel.task.TaskManager

Service

Related Doc: package TaskManager

Permalink

trait Service extends AnyRef

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Service
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def cancelAll(): UIO[Unit]

    Permalink

    Cancel all tasks.

    Cancel all tasks. If a task has not yet begun running, it will simply be cancelled. If a task is already running, it will be interrupted. (see ZIO.interrupt)

  2. abstract def cancelTask(id: String): UIO[Unit]

    Permalink

    Cancel the task with the given ID, and all currently queued or running tasks which were queued or started after the given task was queued or started.

  3. abstract def list: UIO[List[TaskInfo]]

    Permalink

    List all currently running tasks

  4. abstract def queue[R <: CurrentTask, A, R1 >: R <: Has[_]](id: String, label: String = "", detail: String = "", errorWith: (Cause[Throwable]) ⇒ (TaskInfo) ⇒ TaskInfo = cause => _.failed(cause))(task: RIO[R, A])(implicit ev: <:<[R1 with CurrentTask, R]): RIO[R1, Task[A]]

    Permalink

    Queue a task, which can access a reference to the TaskInfo and modify it to broadcast updates.

    Queue a task, which can access a reference to the TaskInfo and modify it to broadcast updates. When the given task finishes, errors, or is interrupted, a completion message of the appropriate status will be broadcast.

    Evaluating the returned outer Task results in queueing of the given task, which will eventually cause the given task to be evaluated. Evaluating the inner Task results in blocking (asynchronously) until the given task completes.

    Interrupting the inner Task results in cancelling the queued task, or interrupting it if it's running.

    Note that status updates are sent somewhat lazily, and for a series of rapid updates to the task status only the last update might get sent.

  5. abstract def register(id: String, label: String = "", detail: String = "", parent: Option[String] = None, errorWith: DoneStatus = ErrorStatus)(cancelCallback: (((TaskInfo) ⇒ TaskInfo) ⇒ Unit) ⇒ ZIO[Logging, Nothing, Unit]): RIO[Blocking with Clock with Logging, Fiber[Throwable, Unit]]

    Permalink

    Register an external task for status broadcasting and cancellation, by providing a function which will receive a function for modifying the TaskInfo and return a UIO that cancels the external task upon evaluation.

    Register an external task for status broadcasting and cancellation, by providing a function which will receive a function for modifying the TaskInfo and return a UIO that cancels the external task upon evaluation. The cancellation task returned by the provided function may be evaluated even after the external task is finished.

    The TaskInfo should be updated by invoking the function (TaskInfo => TaskInfo) => Unit, passing as an argument the function which updates the status (e.g. _.progress(0.5)).

    The external task must report itself as being finished by updating the TaskInfo to a completed or failed state. All updates to the task reference will be broadcast. If cancelAll is run on this task manager, the given task will be interrupted (if it has not yet reported completion) using the return cancellation task.

    Returns the Fiber which updates the task status. Interrupting this fiber results in the cancellation task returned from cancelCallback being evaluated.

  6. abstract def run[R <: Has[_], A](id: String, label: String = "", detail: String = "", errorWith: (Cause[Throwable]) ⇒ (TaskInfo) ⇒ TaskInfo = cause => _.failed(cause))(task: RIO[CurrentTask with R, A]): RIO[R, A]

    Permalink

    Run the given task.

    Run the given task. The task will be independent of the task queue, but will have access to a TaskInfo reference; it can update this reference to broadcast task updates. The first update will be broadcast when the task is evaluated, and a completion update will be broadcast when it completes or fails.

  7. abstract def runSubtask[R <: CurrentTask, A](id: String, label: String = "", detail: String = "", errorWith: (Cause[Throwable]) ⇒ (TaskInfo) ⇒ TaskInfo = cause => _.failed(cause))(task: RIO[R, A]): RIO[R, A]

    Permalink

    Run the given task as a subtask of the current task.

    Run the given task as a subtask of the current task.

    See also

    run

  8. abstract def shutdown(): UIO[Unit]

    Permalink

    Shut down the task manager and stop executing any tasks in the queue.

    Shut down the task manager and stop executing any tasks in the queue. Cancels all running tasks (see cancelAll)

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  10. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  11. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  14. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  15. def queue_[A, R <: Has[_]](id: String, label: String = "", detail: String = "")(task: RIO[R with CurrentTask, A]): RIO[R, Task[A]]

    Permalink

    This overload is more useful if the return type needs to be inferred

  16. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  17. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  18. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped