ui界面优化,event handler优化-新增任务池模式,歌词加载优化,新房间管理(可以自动连接) 本地音频搜索算法优化,

This commit is contained in:
Aynakeya
2022-12-31 21:22:35 -08:00
parent 1e18ca1ff2
commit 9d99a74faf
12 changed files with 117 additions and 41 deletions

View File

@@ -0,0 +1,35 @@
package event
import (
"fmt"
"testing"
"time"
)
func TestEventSeq(t *testing.T) {
m := NewManger(128, 16)
m.RegisterA("ceshi", "asdf1", func(event *Event) {
fmt.Println("Num:", event.Data)
})
go func() {
for i := 0; i < 1000; i++ {
m.CallA("ceshi", fmt.Sprintf("a%d", i))
}
}()
for i := 0; i < 1000; i++ {
m.CallA("ceshi", i)
}
}
func TestEventWeired(t *testing.T) {
m := NewManger(128, 2)
m.RegisterA("playlist.update", "asdf1", func(event *Event) {
fmt.Printf("%d %p, outdated: %t\n", event.Data, event, event.Outdated)
})
for i := 0; i < 2; i++ {
fmt.Println("asdfsafasfasfasfasfasf")
m.CallA("playlist.update", i)
fmt.Println("asdfsafasfasfasfasfasf")
}
time.Sleep(1 * time.Second)
}