routine

package
v0.31.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendTask

func AppendTask(ctx context.Context, t *Task) bool

AppendTask appends a task executed after completion of existing task. It is a no-op if there is no existing task.

func WithRoutine

func WithRoutine(handler http.Handler, longRunning request.LongRunningRequestCheck) http.Handler

WithRoutine returns an http.Handler that executes preparation of long running requests (i.e. watches) in a separate Goroutine and then serves the long running request in the main Goroutine. Doing so allows freeing stack memory used in preparation Goroutine for better memory efficiency.

func WithTask

func WithTask(parent context.Context, t *Task) context.Context

Types

type Task

type Task struct {
	Func func()
}

func TaskFrom

func TaskFrom(ctx context.Context) *Task

Jump to

Keyboard shortcuts

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