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:
2025-12-27 12:24:36 +07:00
parent e1d0ab5ea6
commit c292fef0ac
7 changed files with 52 additions and 19 deletions
+5 -1
View File
@@ -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()