StringType changed
This commit is contained in:
parent
bf078e46ed
commit
64d8250a48
10
queue.go
10
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)
|
||||
|
|
|
@ -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")
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user