fusen-render/queue_test.go
2023-07-28 19:04:21 +08:00

35 lines
484 B
Go

package fusenrender
import (
"log"
"testing"
"time"
)
func TestQueue(t *testing.T) {
q, err := NewQueue("/tmp/fusenrender")
if err != nil {
panic(err)
}
group := "fusen"
q.Enqueue(&QueueItem{
Group: group,
Priority: 1,
CreateAt: time.Now(),
Data: nil,
})
q.Enqueue(&QueueItem{
Group: group,
Priority: 2,
CreateAt: time.Now(),
Data: nil,
})
log.Println(q.Dequeue(group))
log.Println(q.Dequeue(group))
log.Println(q.Dequeue(group))
}