Documentation
¶
Overview ¶
Package sequence contains sequence box implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrGap = xerrors.Errorf("gap")
ErrGap says that there is a gap in the sequence that must be recovered manually.
Functions ¶
This section is empty.
Types ¶
type Box ¶
type Box struct {
// contains filtered or unexported fields
}
Box helps to apply updates in correct order.
func (*Box) DisableBuffering ¶
func (b *Box) DisableBuffering()
DisableBuffering disables buffer mode. Should be called after the difference has been received.
Transitions:
- buffer -> normal
func (*Box) EnableBuffering ¶
func (b *Box) EnableBuffering()
EnableBuffering enables buffer mode. Should be called before fetching diffs.
Transitions:
- normal -> buffer
- fastgap -> buffer
func (*Box) ExtractBuffer ¶
func (b *Box) ExtractBuffer() []interface{}
ExtractBuffer returns buffered updates.
type Config ¶
type Config struct { InitialState int FastgapTimeout time.Duration Apply func(state int, updates []interface{}) error Logger *zap.Logger // contains filtered or unexported fields }
Config is the sequence box config.
type ResultError ¶
type ResultError struct {
Err error
}
ResultError allows apply-functions to pass errors through the box without affecting it.
func (*ResultError) Error ¶
func (e *ResultError) Error() string
func (*ResultError) Unwrap ¶
func (e *ResultError) Unwrap() error
Unwrap implements error unwrap interface.
Click to show internal directories.
Click to hide internal directories.