From 64d8250a48c84901f28bc848435d5ece510ec07a Mon Sep 17 00:00:00 2001 From: geek Date: Wed, 26 Apr 2017 17:07:49 +0900 Subject: [PATCH] StringType changed --- queue.go | 10 +++++----- queue_test.go | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/queue.go b/queue.go index 0cecd52..7f85b48 100644 --- a/queue.go +++ b/queue.go @@ -78,7 +78,7 @@ func (lq *LoafleQueue) notifyEventHandler(c chan interface{}) { } } -func (lq *LoafleQueue) StringType(tp EventType) string { +func StringType(tp EventType) string { var tempType string if tp == DATA_TYPE { @@ -101,15 +101,15 @@ func NewQueue(eventType EventType, interval time.Duration) *LoafleQueue { items := make([]*Item, 0) event := make(chan interface{}, 0) + tempType := StringType(eventType) + lq := &LoafleQueue{ - items: items, - //queueType: tempType, + items: items, + queueType: tempType, interval: interval, eventChanel: event, } - lq.queueType = lq.StringType(eventType) - heap.Init(lq) observer.Add(lq.queueType, lq.eventChanel) diff --git a/queue_test.go b/queue_test.go index c86849e..422afe5 100644 --- a/queue_test.go +++ b/queue_test.go @@ -8,7 +8,7 @@ import ( func TestNewQueue(t *testing.T) { lq := NewQueue(EVENT_TYPE, 5) - typeEvent := lq.StringType(EVENT_TYPE) + typeEvent := StringType(EVENT_TYPE) observer.Notify(typeEvent, "data")