summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'pkg')
-rw-r--r--pkg/priority_queue/interface.go3
-rw-r--r--pkg/priority_queue/queue.go8
2 files changed, 6 insertions, 5 deletions
diff --git a/pkg/priority_queue/interface.go b/pkg/priority_queue/interface.go
index 5945a013..00998d78 100644
--- a/pkg/priority_queue/interface.go
+++ b/pkg/priority_queue/interface.go
@@ -1,7 +1,6 @@
package priorityqueue
type Queue interface {
- Push()
+ Push(item interface{})
Pop() interface{}
- BLPop()
}
diff --git a/pkg/priority_queue/queue.go b/pkg/priority_queue/queue.go
index 79afab18..c12acbf6 100644
--- a/pkg/priority_queue/queue.go
+++ b/pkg/priority_queue/queue.go
@@ -1,15 +1,17 @@
package priorityqueue
+import "fmt"
+
type QueueImpl struct {
}
func NewPriorityQueue() *QueueImpl {
- return nil
+ return &QueueImpl{}
}
// Push the task
-func (q *QueueImpl) Push() {
-
+func (q *QueueImpl) Push(item interface{}) {
+ fmt.Println(item)
}
func (q *QueueImpl) Pop() interface{} {