Add comprehensive godoc documentation to handler.go
Expand documentation comments for SimpleHandler type and its methods to better explain their purpose, parameters, and behavior.
This commit is contained in:
@@ -171,7 +171,11 @@ func (h *ASHandler) flushBatchLocked() {
|
||||
h.lastFlush = time.Now()
|
||||
}
|
||||
|
||||
// Stop gracefully stops the handler and flushes remaining batches
|
||||
// Stop gracefully shuts down the ASHandler by signaling the background flush
|
||||
// goroutine to terminate and waiting for it to complete. Any pending ASN
|
||||
// operations in the current batch are flushed to the database before Stop
|
||||
// returns. This method should be called during application shutdown to ensure
|
||||
// no data is lost.
|
||||
func (h *ASHandler) Stop() {
|
||||
close(h.stopCh)
|
||||
h.wg.Wait()
|
||||
|
||||
Reference in New Issue
Block a user