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
|
var tempType string
|
||||||
|
|
||||||
if tp == DATA_TYPE {
|
if tp == DATA_TYPE {
|
||||||
|
@ -101,15 +101,15 @@ func NewQueue(eventType EventType, interval time.Duration) *LoafleQueue {
|
||||||
items := make([]*Item, 0)
|
items := make([]*Item, 0)
|
||||||
event := make(chan interface{}, 0)
|
event := make(chan interface{}, 0)
|
||||||
|
|
||||||
|
tempType := StringType(eventType)
|
||||||
|
|
||||||
lq := &LoafleQueue{
|
lq := &LoafleQueue{
|
||||||
items: items,
|
items: items,
|
||||||
//queueType: tempType,
|
queueType: tempType,
|
||||||
interval: interval,
|
interval: interval,
|
||||||
eventChanel: event,
|
eventChanel: event,
|
||||||
}
|
}
|
||||||
|
|
||||||
lq.queueType = lq.StringType(eventType)
|
|
||||||
|
|
||||||
heap.Init(lq)
|
heap.Init(lq)
|
||||||
|
|
||||||
observer.Add(lq.queueType, lq.eventChanel)
|
observer.Add(lq.queueType, lq.eventChanel)
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
|
|
||||||
func TestNewQueue(t *testing.T) {
|
func TestNewQueue(t *testing.T) {
|
||||||
lq := NewQueue(EVENT_TYPE, 5)
|
lq := NewQueue(EVENT_TYPE, 5)
|
||||||
typeEvent := lq.StringType(EVENT_TYPE)
|
typeEvent := StringType(EVENT_TYPE)
|
||||||
|
|
||||||
observer.Notify(typeEvent, "data")
|
observer.Notify(typeEvent, "data")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user