github.com/v2pro/plz@v0.0.0-20221028024117-e5f9aec5b631/countlog/stats/async.go (about)

     1  package stats
     2  
     3  import (
     4  	"context"
     5  )
     6  
     7  type Executor func(func(ctx context.Context))
     8  
     9  func DefaultExecutor(handler func(ctx context.Context)) {
    10  	go func() {
    11  		handler(context.Background())
    12  	}()
    13  }