Skip to content

Comments

允许替换任务执行方式#46

Open
yeaha wants to merge 1 commit intoRussellLuo:masterfrom
yeaha:master
Open

允许替换任务执行方式#46
yeaha wants to merge 1 commit intoRussellLuo:masterfrom
yeaha:master

Conversation

@yeaha
Copy link

@yeaha yeaha commented Mar 10, 2023

提供SetTaskRunner()方法,允许自行实现任务具体的执行方式

例如可以使用goroutine pool进一步提高并发执行效率

import (
  "github.com/panjf2000/ants"
  "github.com/RussellLuo/timingwheel"
)

func init() {
  timingwheel.SetTaskRunner(func(task func()) {
    ants.Submit(task)
  })
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant