- Added a property with table information to session and result set Script types - Added the ability to add new key bindings to the script - Rebuilt the foreground job dispatcher to reduce the occurrence of the progress indicator showing up when no job was running. - Fixed rebinding of keys. Rebinding a key will no longer clear other keys for the old or new bindings.
33 lines
483 B
Go
33 lines
483 B
Go
package jobs
|
|
|
|
import "context"
|
|
|
|
const (
|
|
JobStartEvent = "jobs.start"
|
|
JobIdleEvent = "jobs.idle"
|
|
JobUpdateEvent = "jobs.update"
|
|
)
|
|
|
|
type EventData struct {
|
|
Job Job
|
|
}
|
|
|
|
type Job interface {
|
|
Execute(ctx context.Context)
|
|
}
|
|
|
|
type JobFunc func(ctx context.Context)
|
|
|
|
func (jf JobFunc) Execute(ctx context.Context) {
|
|
jf(ctx)
|
|
}
|
|
|
|
func WithDescription(description string, job Job) Job {
|
|
return DescribableJob{job, description}
|
|
}
|
|
|
|
type DescribableJob struct {
|
|
Job
|
|
Description string
|
|
}
|