forked from p93542168/wheat-cache
feat(middle): add middle worker function
This commit is contained in:
parent
79bef5ba72
commit
dca19238da
|
@ -11,6 +11,7 @@ func (m *MiddleWare) middleWorker() {
|
||||||
for _, singles := range m.plugins {
|
for _, singles := range m.plugins {
|
||||||
for _, single := range singles {
|
for _, single := range singles {
|
||||||
single.Exec(workEvent)
|
single.Exec(workEvent)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@ import (
|
||||||
|
|
||||||
func TestWorker(t *testing.T) {
|
func TestWorker(t *testing.T) {
|
||||||
event := event.NewEvent("LogContext")
|
event := event.NewEvent("LogContext")
|
||||||
|
|
||||||
m := NewMiddleWare()
|
m := NewMiddleWare()
|
||||||
m.eventDriver.Put(event)
|
m.eventDriver.Put(event)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue