Skip to content

fork from rfyiamcool/go-timewheel and modify by ashing

Notifications You must be signed in to change notification settings

cloud-org/go-timewheel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-timewheel

自用魔改时间轮。

usage

package main_test

func TestTimeWheelAdd(t *testing.T) {
	tw, err := NewTimeWheel(1*time.Second, 3)
	if err != nil {
		fmt.Println(err)
	}
	tw.Start()
	defer tw.Stop()
	var wg sync.WaitGroup
	wg.Add(1)
	tw.Add(0*time.Second, func() {
		defer wg.Done()
		log.Println("hello world")
	})
	wg.Wait()
}

About

fork from rfyiamcool/go-timewheel and modify by ashing

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages