ctxrun

package
v0.10.7 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package ctxrun provides a context-canceling goroutine runner.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Runner

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

Runner runs a goroutine and cancels the context of any previous call to run.

func New

func New() *Runner

func (*Runner) Go

func (r *Runner) Go(ctx context.Context, fn func(ctx context.Context))

Go cancels the context of the currently running goroutine (if any) and runs fn in a new goroutine without waiting for the previous to return.

Jump to

Keyboard shortcuts

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