Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cell = cell.Module( "kvstore-heartbeat-updater", "KVStore Heartbeat Updater", cell.Invoke(func(lc hive.Lifecycle, backendPromise promise.Promise[kvstore.BackendOperations]) { ctx, cancel := context.WithCancel(context.Background()) var wg sync.WaitGroup lc.Append(hive.Hook{ OnStart: func(hive.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 hive.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.