async-tasks

command
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Async tasks — managed background work, safe by construction.

A "fruit search" backed by a deliberately slow lookup. Compare this with the old pattern (see examples/sync-demo): there you keep a `Processing bool`, a hand-rolled `if Processing { return }` re-entry guard, a raw goroutine, and manual Refresh() calls. Here, Task() handles all of that:

  • the closure runs OFF the event loop (so it may block), and never touches island fields directly — state changes go back through t.Apply;
  • pending/progress bind without an app field via Busy()/Progress();
  • WithRestart() cancels an in-flight search when a new one starts.

Jump to

Keyboard shortcuts

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