walutil

package
v1.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FlushInterval

func FlushInterval(logger *wal.Logger, d time.Duration, onError func(error))

FlushInterval creates a time.Timer to fire after the given time.Duration d, to call logger.Flush(). If logger.Flush() returns a non-nil error, the onError function is called, with the non-nil error as an argument.

If the non-nil error returned from logger.Flush() is wal.ErrLoggerClosed, this function will exit. It is recommended to call this function in its own goroutine.

logger, err := wal.NewLogger(NewDirectorySink("/tmp/wal.d"))
if err != nil {
	...
}

go FlushInterval(logger, 10*time.Second, func(err error) {
	log.Println("error flushing wal:", err)
})

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL