31 lines
501 B
Go
31 lines
501 B
Go
package lru
|
|
|
|
import (
|
|
"context"
|
|
"gitee.com/timedb/wheatCache/pkg/event"
|
|
"log"
|
|
)
|
|
|
|
func lruCleanWork() {
|
|
|
|
}
|
|
|
|
func (lru *singleCache) lruSingleWork() interface{} {
|
|
ctx := context.Background()
|
|
for {
|
|
workEvent := lru.lruConsumer.Receive(ctx)
|
|
|
|
workFunc, ok := workEvent.GetValue(WorkFuncEventKey)
|
|
if !ok {
|
|
continue
|
|
}
|
|
|
|
switch workFunc.(type) {
|
|
case event.EventWorkFunc:
|
|
workEvent.ExecWorkAndSendResult(workFunc.(event.EventWorkFunc))
|
|
default:
|
|
log.Print("this is debug ")
|
|
}
|
|
}
|
|
}
|