Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cell = cell.Module( "kvstore-heartbeat-updater", "KVStore Heartbeat Updater", cell.Invoke(func(lc cell.Lifecycle, backendPromise promise.Promise[kvstore.BackendOperations]) { ctx, cancel := context.WithCancel(context.Background()) var wg sync.WaitGroup lc.Append(cell.Hook{ OnStart: func(cell.HookContext) error { wg.Add(1) go func() { defer wg.Done() backend, err := backendPromise.Await(ctx) if err != nil { return } Heartbeat(ctx, backend) }() return nil }, OnStop: func(ctx cell.HookContext) error { cancel() wg.Wait() return nil }, }) }), )
Cell creates a cell responsible for periodically updating the heartbeat key in the kvstore.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.