MCPcopy Create free account
hub / github.com/cloudbase/garm / loop

Method loop

workers/cache/cache.go:545–562  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

543}
544
545func (w *Worker) loop() {
546 defer w.Stop()
547 for {
548 select {
549 case <-w.quit:
550 return
551 case event, ok := <-w.consumer.Watch():
552 if !ok {
553 slog.InfoContext(w.ctx, "consumer channel closed")
554 return
555 }
556 w.handleEvent(event)
557 case <-w.ctx.Done():
558 slog.DebugContext(w.ctx, "context done")
559 return
560 }
561 }
562}
563
564func (w *Worker) rateLimitLoop() {
565 defer w.Stop()

Callers 1

StartMethod · 0.95

Calls 4

StopMethod · 0.95
handleEventMethod · 0.95
WatchMethod · 0.65
DoneMethod · 0.45

Tested by

no test coverage detected