tabrunner

tabrunner
Login

import "foutaise.org/fossil/tabrunner"

Package tabrunner implements a gui frontend to execute several Jobs in parallel, and display the output of each job in a tabbed interface.

When a job is done, buttons appear at the bottom of each tab in order to close the tab («Done» button), or rerun the job («Retry» button).

Usage

func Run

func Run(nthreads int, jobs []*Job)

Execute a list of jobs, using nthreads concurrent threads (goroutines).

type Job

type Job struct {
	TabTitle string          // title of the gui tab
	Run      func(io.Writer) // command to run the job
}

A Job represents a single job to execute.

Output produced by the job should be written to the io.Writer argument to be displayed in the gui tab.