hrtools/server/task.go
2021-04-27 18:36:08 +08:00

29 lines
382 B
Go

package main
import (
"sync"
pqueuekey "github.com/474420502/focus/priority_queuekey"
"github.com/gin-gonic/gin"
)
type Task struct {
}
type Queue struct {
lock sync.Mutex
count uint64
queue *pqueuekey.PriorityQueue
}
func (q *Queue) Push(task *Task) {
q.lock.Lock()
defer q.lock.Unlock()
q.count++
q.queue.Push(q.count, task)
}
func PushQueue(c *gin.Context) {
}