taskdemo

package
v0.0.19 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 28, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package taskdemo is the ADR-0038 M2 + M4 showcase app. One window with two sections: spawn controls (pick a unit, pick a duration, pick whether the task should "fail" near the end), and a taskmonitor widget that renders the in-flight + history panes with per-row cancel button and error-text details.

The fake worker is a single goroutine per spawned task that loops for the configured duration, calling Report at fixed wall-clock intervals. Report's humanized-change gate is what produces the pleasantly throttled progress bar; the gate is not visible to the producer code — it just calls Report as fast as it wants.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

App is the per-window taskdemo instance.

func (*App) Frame

func (inst *App) Frame(ctx app.FrameContextI) (err error)

Frame renders one frame of the taskdemo window body. The host has already pre-pushed a window-unique salt onto inst.ids via c.IdScope (windowhost.renderWindowBody, ADR-0026 §SD9), so widget ids derived from inst.ids are unique across all concurrently open instances — the app must not Reset() the stack or wrap the body in its own instance salt (doing so discards the host salt and collides with sibling apps that share a label string).

func (*App) Manifest

func (inst *App) Manifest() (m app.Manifest)

func (*App) Mount

func (inst *App) Mount(ctx app.MountContextI) (err error)

Mount captures the host-supplied TaskApiI, constructs + starts the taskmonitor widget, and prepares an app-scoped context so Unmount can cancel in-flight tasks immediately rather than waiting on the host's reapClosed path.

func (*App) Unmount

func (inst *App) Unmount(ctx app.MountContextI) (err error)

Unmount cancels in-flight tasks via appCtx, briefly waits for the resulting terminal publications so OnDone drains the monitor's in-flight map, then stops the monitor (unsubscribes the observer).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL