task

package
v0.0.0-...-6e85980 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Task

type Task struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func New

func New() *Task

func (*Task) Cancel

func (t *Task) Cancel()

Cancel calls the context cancel function, aborting the task.

func (*Task) Done

func (t *Task) Done() bool

Returns true if the task is done.

func (*Task) Launch

func (t *Task) Launch(p io.ReadWriteCloser, gcs store.Stream) error

func (*Task) Subscribe

func (t *Task) Subscribe() chan TaskStatus

Returns a channel which posts updates about the print status.

func (*Task) Unsubscribe

func (t *Task) Unsubscribe(c chan TaskStatus)

func (*Task) WaitDone

func (t *Task) WaitDone() <-chan struct{}

type TaskStatus

type TaskStatus struct {
	// Filename we are currently executing.
	File string
	// Human readable description.
	Text string
	// Percentage printend.
	Done float64
	// Whether or not we actually do anything.
	Active bool
	// Time we started this print
	Started time.Time
	// Last command we sent.
	LastCommand string
	// Last reply we received.
	LastReply string
}

Jump to

Keyboard shortcuts

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