task

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2026 License: GPL-3.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sender

type Sender struct {
	// contains filtered or unexported fields
}

Sender writes log lines to a task.

func (Sender) Complete

func (s Sender) Complete(status Status)

func (Sender) Write

func (s Sender) Write(line string)

type Status

type Status int
const (
	Running Status = iota
	Completed
	Failed
)

type Store

type Store struct {
	// contains filtered or unexported fields
}

func NewStore

func NewStore() *Store

func (*Store) AppID added in v0.0.2

func (s *Store) AppID(id string) string

AppID returns the app ID associated with a task, or empty string if not found.

func (*Store) Create

func (s *Store) Create(id, appID string) Sender

Create registers a new running task. Returns a Sender for writing log lines.

func (*Store) CreatedAt

func (s *Store) CreatedAt(id string) string

CreatedAt returns the task's creation timestamp as an RFC3339 string. Returns empty string if the task is not found.

func (*Store) Status

func (s *Store) Status(id string) (Status, bool)

Status returns the task's current status. Returns false if not found.

func (*Store) Subscribe

func (s *Store) Subscribe(id string) (snapshot []string, live <-chan string, done <-chan struct{}, ok bool)

Subscribe returns a snapshot of buffered lines and a channel for live lines written after the snapshot. The live channel only delivers new lines — no dedup needed by the caller. The done channel is closed when the task completes.

Jump to

Keyboard shortcuts

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