contextscope

package
v0.0.0-...-a532a67 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: LGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() app.ContextScope

New create new instance of context scope

func NewIsolated

func NewIsolated(parent app.ContextScope) app.ContextScope

NewIsolated create new isolated context scope instance

Types

type ContextScope

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

ContextScope is default context scope

func (*ContextScope) AppendError

func (s *ContextScope) AppendError(errs ...error)

AppendErrors append many errors to scope (skip nil errors)

func (*ContextScope) Deadline

func (s *ContextScope) Deadline() (deadline time.Time, ok bool)

Deadline returns the time when work done on behalf of this context should be canceled. Deadline returns ok==false when no deadline is set. Successive calls to Deadline return the same results.

func (*ContextScope) Done

func (s *ContextScope) Done() <-chan struct{}

Done is close when the scope context is done (kill or stop)

func (*ContextScope) Err

func (s *ContextScope) Err() error

Err return cumulative error if the scope context contains any error

func (*ContextScope) Errors

func (s *ContextScope) Errors() []error

Errors return scope errors

func (*ContextScope) IsDone

func (s *ContextScope) IsDone() bool

IsDone check if the scope context is done (kill or stop)

func (*ContextScope) Kill

func (s *ContextScope) Kill()

Kill scope

func (*ContextScope) Stop

func (s *ContextScope) Stop()

Stop stop the scope context without error

type Isolated

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

The isolated scope is a isolated context scope depended from parent scope. The isolated scope doesn't affect parent.

func (*Isolated) AppendError

func (scp *Isolated) AppendError(errs ...error)

AppendErrors append many errors to scope (skip nil errors)

func (*Isolated) Deadline

func (scp *Isolated) Deadline() (deadline time.Time, ok bool)

Deadline returns the time when work done on behalf of this context should be canceled. Deadline returns ok==false when no deadline is set. Successive calls to Deadline return the same results.

func (*Isolated) Done

func (scp *Isolated) Done() <-chan struct{}

Done is close when the scope context is done (kill or stop)

func (*Isolated) Err

func (scp *Isolated) Err() error

Err return cumulative error if the scope context contains any error

func (*Isolated) Errors

func (scp *Isolated) Errors() []error

Errors return scope errors

func (*Isolated) IsDone

func (scp *Isolated) IsDone() bool

IsDone check if the scope context is done (kill or stop)

func (*Isolated) Kill

func (scp *Isolated) Kill()

Kill scope

func (*Isolated) Stop

func (scp *Isolated) Stop()

Stop stop the scope context without error

Jump to

Keyboard shortcuts

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