concurrent

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyCtx

func CopyCtx(ctxFrom context.Context, ctxTo context.Context) context.Context

func SafeChanConsume

func SafeChanConsume(ctx context.Context, w *sync.WaitGroup, concurrent int, ch <-chan *EventWithCtx, f func(context.Context, interface{}))

func SafeGo

func SafeGo(ctx context.Context, w *sync.WaitGroup, concurrent int,
	f func(ctx context.Context))

Types

type EventWithCtx

type EventWithCtx struct {
	Event interface{}

	Ctx context.Context
}

type SafeApp

type SafeApp struct {
	*logger.Entry
	Name string //app name
	// contains filtered or unexported fields
}

func (*SafeApp) Init

func (sa *SafeApp) Init(name string)

func (*SafeApp) SafeHandleGroup

func (sa *SafeApp) SafeHandleGroup(taskName string, concurrent int, input <-chan *EventWithCtx, hanlder func(context.Context, interface{}))

func (*SafeApp) SafeRun

func (sa *SafeApp) SafeRun(taskName string, concurrent int, f func(ctx context.Context))

func (*SafeApp) Uninit

func (sa *SafeApp) Uninit()

Jump to

Keyboard shortcuts

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