wheat-cache/pkg/lru/worker.go

31 lines
498 B
Go

package lru
import (
"context"
"gitee.com/timedb/wheatCache/pkg/event"
"log"
)
func lruCleanWork() {
}
func (lru *singleCache) lruSingleWork() interface{} {
ctx := context.Background()
for {
eventKon := lru.lruConsumer.Receive(ctx)
worFunc, ok := eventKon.GetValue(WorkFuncEventCtxKey)
if !ok {
continue
}
switch worFunc.(type) {
case event.EventWorkFunc:
eventKon.ExecWorkAndSendResult(worFunc.(event.EventWorkFunc))
default:
log.Print("this is debug ")
}
}
}