fsevent

package
v0.20.2 Latest Latest
Warning

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

Go to latest
Published: May 7, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const BufferMaxDuration = 10 * time.Second

BufferMaxDuration prevents excessive delays when bundling together file changes by emitting an event to the channel if the threshold is reached even if new file changes are still coming in.

View Source
const BufferMinRestDuration = 200 * time.Millisecond

BufferMinRestDuration bundles many file changes together by waiting a short amount of time after a file change before emitting an event to the channel.

200ms is not the result of any kind of research or experimentation it might end up being a significant part of deployment delay, if we get the total latency <2s it might also be long enough that it misses some changes if the user has some operation involving a large file

(e.g., a binary dependency in git), but that's hopefully less of a problem since we'd get it in the next build

Variables

This section is empty.

Functions

func Coalesce

func Coalesce(timerMaker TimerMaker, eventChan <-chan watch.FileEvent) <-chan []watch.FileEvent

Coalesce makes an attempt to read some events from `eventChan` so that multiple file changes that happen at the same time from the user's perspective are grouped together.

Types

type FakeMultiWatcher

type FakeMultiWatcher struct {
	Events chan watch.FileEvent
	Errors chan error
	// contains filtered or unexported fields
}

func NewFakeMultiWatcher

func NewFakeMultiWatcher() *FakeMultiWatcher

func (*FakeMultiWatcher) NewSub

func (w *FakeMultiWatcher) NewSub(paths []string, ignore watch.PathMatcher, _ logger.Logger) (watch.Notify, error)

type FakeTimerMaker

type FakeTimerMaker struct {
	RestTimerLock *sync.Mutex
	MaxTimerLock  *sync.Mutex
	// contains filtered or unexported fields
}

func MakeFakeTimerMaker

func MakeFakeTimerMaker(t *testing.T) FakeTimerMaker

func (FakeTimerMaker) Maker

func (f FakeTimerMaker) Maker() TimerMaker

type FakeWatcher

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

func NewFakeWatcher

func NewFakeWatcher(inboundCh chan watch.FileEvent, errorCh chan error, paths []string, ignore watch.PathMatcher) *FakeWatcher

func (*FakeWatcher) Close

func (w *FakeWatcher) Close() error

func (*FakeWatcher) Errors

func (w *FakeWatcher) Errors() chan error

func (*FakeWatcher) Events

func (w *FakeWatcher) Events() chan watch.FileEvent

func (*FakeWatcher) Start

func (w *FakeWatcher) Start() error

type TimerMaker

type TimerMaker func(d time.Duration) <-chan time.Time

func ProvideTimerMaker

func ProvideTimerMaker() TimerMaker

type WatcherMaker

type WatcherMaker func(paths []string, ignore watch.PathMatcher, l logger.Logger) (watch.Notify, error)

func ProvideWatcherMaker

func ProvideWatcherMaker() WatcherMaker

Jump to

Keyboard shortcuts

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