refactor: fork boomer as sub module

This commit is contained in:
debugtalk
2021-12-22 17:21:52 +08:00
parent 4696a18eb4
commit 8ef4ad4282
20 changed files with 2329 additions and 45 deletions
+13
View File
@@ -0,0 +1,13 @@
package boomer
// Task is like the "Locust object" in locust, the python version.
// When boomer receives a start message from master, it will spawn several goroutines to run Task.Fn.
// But users can keep some information in the python version, they can't do the same things in boomer.
// Because Task.Fn is a pure function.
type Task struct {
// The weight is used to distribute goroutines over multiple tasks.
Weight int
// Fn is called by the goroutines allocated to this task, in a loop.
Fn func()
Name string
}