29 lines
382 B
Go
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) {
|
|
|
|
}
|