restartcontroller

package
v0.0.0-...-ea0be71 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Wrapper for running a restartable fn. it gets its restart signal via context cancellation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

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

func New

func New(logger *log.Logger) *Controller

func (*Controller) Restart

func (r *Controller) Restart() error

returns immediately

func (*Controller) Run

func (r *Controller) Run(ctx context.Context, run func(ctx context.Context) error) error

Jump to

Keyboard shortcuts

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