I usually have one table row per background task. The row has a status
column and maybe other notes
or errors
columns, as described here.
You can use the Task
object to communicate with background tasks as described here, but I like to use a datatable row, for many reasons, including I can search for rows with status=='running'
and restart a task after it crashes.