ProgressSession

interface ProgressSession<out F : Failure> : Session<F>

A Session with a progress.

Types

Link copied to clipboard
fun interface ProgressListener

Callback interface for listening to ProgressSession progress updates.

Properties

Link copied to clipboard
abstract val id: UUID

Returns the ID of this session.

Link copied to clipboard
abstract val isActive: Boolean

Returns true if this session is active, i.e. it is already launched and is not in terminal state.

Link copied to clipboard
abstract val isCancelled: Boolean

Returns true if this session was cancelled by invocation of cancel.

Link copied to clipboard
abstract val isCompleted: Boolean

Returns true if this session has ran to completion without cancelling.

Functions

Link copied to clipboard

Adds a ProgressListener to this session if it's not registered yet and appends the subscription to the subscriptions bag. The listener will be notified with current progress immediately upon registering.

Link copied to clipboard

Adds a StateListener to this session if it's not registered yet and appends the subscription to the subscriptions bag. The listener will be notified with current state immediately upon registering.

Link copied to clipboard
abstract fun cancel()

Cancels this session, rendering it invalid.

Link copied to clipboard
abstract fun commit(): Boolean

Commits everything that was prepared in the session. This will launch user's confirmation of installation or uninstallation.

Link copied to clipboard
abstract fun launch(): Boolean

Launches the session preparations. This includes copying needed files to temporary folder and other operations.

Link copied to clipboard

Removes the provided ProgressListener from this session.

Link copied to clipboard

Removes the provided StateListener from this session.