hrtools/server/task.go

29 lines
382 B
Go
Raw Normal View History

2021-04-27 10:36:08 +00:00
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) {
}