Documentation
¶
Index ¶
- Constants
- Variables
- func HandleFileWatchCreateEvent(_ context.Context, state *store.EngineState, action FileWatchCreateAction)
- func HandleFileWatchDeleteEvent(_ context.Context, state *store.EngineState, action FileWatchDeleteAction)
- func HandleFileWatchUpdateEvent(ctx context.Context, state *store.EngineState, action FileWatchUpdateAction)
- func HandleFileWatchUpdateStatusEvent(ctx context.Context, state *store.EngineState, ...)
- func SpecsForManifests(manifests []model.Manifest, globalIgnores []model.Dockerignore) map[model.TargetID]filewatches.FileWatchSpec
- type FakeMultiWatcher
- type FakeTimerMaker
- type FakeWatcher
- type FileWatchCreateAction
- type FileWatchDeleteAction
- type FileWatchUpdateAction
- type FileWatchUpdateStatusAction
- type FsWatcherMaker
- type TimerMaker
- type WatchManager
- type WatchableTarget
Constants ¶
const BufferMaxDuration = 10 * time.Second
When waiting for a `watchBufferDurationInMs`-long break in file modifications to aggregate notifications, if we haven't seen a break by the time `watchBufferMaxTimeInMs` has passed, just send off whatever we've got
const BufferMinRestDuration = 200 * time.Millisecond
When we see a file change, wait this long to see if any other files have changed, and bundle all changes together. 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
const DetectedOverflowErrMsg = `` /* 189-byte string literal not displayed */
Variables ¶
var ConfigsTargetID = model.TargetID{ Type: model.TargetTypeConfigs, Name: "singleton", }
Functions ¶
func HandleFileWatchCreateEvent ¶ added in v0.18.12
func HandleFileWatchCreateEvent(_ context.Context, state *store.EngineState, action FileWatchCreateAction)
func HandleFileWatchDeleteEvent ¶ added in v0.18.12
func HandleFileWatchDeleteEvent(_ context.Context, state *store.EngineState, action FileWatchDeleteAction)
func HandleFileWatchUpdateEvent ¶ added in v0.18.12
func HandleFileWatchUpdateEvent(ctx context.Context, state *store.EngineState, action FileWatchUpdateAction)
func HandleFileWatchUpdateStatusEvent ¶ added in v0.18.12
func HandleFileWatchUpdateStatusEvent(ctx context.Context, state *store.EngineState, action FileWatchUpdateStatusAction)
func SpecsForManifests ¶ added in v0.18.12
func SpecsForManifests(manifests []model.Manifest, globalIgnores []model.Dockerignore) map[model.TargetID]filewatches.FileWatchSpec
SpecsForManifests creates FileWatch specs from Tilt manifests.
Types ¶
type FakeMultiWatcher ¶
type FakeMultiWatcher struct { Events chan watch.FileEvent Errors chan error // contains filtered or unexported fields }
func NewFakeMultiWatcher ¶
func NewFakeMultiWatcher() *FakeMultiWatcher
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 FileWatchCreateAction ¶ added in v0.18.12
type FileWatchCreateAction struct {
FileWatch *filewatches.FileWatch
}
func NewFileWatchCreateAction ¶ added in v0.18.12
func NewFileWatchCreateAction(fw *filewatches.FileWatch) FileWatchCreateAction
func (FileWatchCreateAction) Action ¶ added in v0.18.12
func (FileWatchCreateAction) Action()
type FileWatchDeleteAction ¶ added in v0.18.12
type FileWatchDeleteAction struct {
Name types.NamespacedName
}
func NewFileWatchDeleteAction ¶ added in v0.18.12
func NewFileWatchDeleteAction(name types.NamespacedName) FileWatchDeleteAction
func (FileWatchDeleteAction) Action ¶ added in v0.18.12
func (FileWatchDeleteAction) Action()
type FileWatchUpdateAction ¶ added in v0.18.12
type FileWatchUpdateAction struct {
FileWatch *filewatches.FileWatch
}
func NewFileWatchUpdateAction ¶ added in v0.18.12
func NewFileWatchUpdateAction(fw *filewatches.FileWatch) FileWatchUpdateAction
func (FileWatchUpdateAction) Action ¶ added in v0.18.12
func (FileWatchUpdateAction) Action()
type FileWatchUpdateStatusAction ¶ added in v0.18.12
type FileWatchUpdateStatusAction struct { Name types.NamespacedName Status *filewatches.FileWatchStatus }
func NewFileWatchUpdateStatusAction ¶ added in v0.18.12
func NewFileWatchUpdateStatusAction(name types.NamespacedName, fwStatus *filewatches.FileWatchStatus) FileWatchUpdateStatusAction
func (FileWatchUpdateStatusAction) Action ¶ added in v0.18.12
func (FileWatchUpdateStatusAction) Action()
type FsWatcherMaker ¶
type FsWatcherMaker func(paths []string, ignore watch.PathMatcher, l logger.Logger) (watch.Notify, error)
func ProvideFsWatcherMaker ¶
func ProvideFsWatcherMaker() FsWatcherMaker
type TimerMaker ¶
func ProvideTimerMaker ¶
func ProvideTimerMaker() TimerMaker
type WatchManager ¶
type WatchManager struct {
// contains filtered or unexported fields
}
func NewWatchManager ¶
func NewWatchManager(watcherMaker FsWatcherMaker, timerMaker TimerMaker) *WatchManager
func (*WatchManager) DisableForTesting ¶
func (w *WatchManager) DisableForTesting()
func (*WatchManager) OnChange ¶
func (w *WatchManager) OnChange(ctx context.Context, st store.RStore, _ store.ChangeSummary)
func (*WatchManager) TargetWatchCount ¶
func (w *WatchManager) TargetWatchCount() int
type WatchableTarget ¶
type WatchableTarget interface { ignore.IgnorableTarget Dependencies() []string ID() model.TargetID }
If you modify this interface, you might also need to update the watchRulesMatch function below.