feat: add function support (#897)

This commit is contained in:
junhuaqin 2024-12-10 16:19:01 +08:00 committed by GitHub
parent 5cea294fb0
commit 44f0b95c41
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 1 deletions

View File

@ -129,8 +129,14 @@ func (ld *Loader) parseRDBEntry(ctx context.Context, rd *bufio.Reader) {
_ = structure.ReadLength(rd) // slot_id
_ = structure.ReadLength(rd) // slot_size
_ = structure.ReadLength(rd) // expires_slot_size
case kFlagFunction, kFlagFunction2:
case kFlagFunction:
log.Panicf("function library data not supported, need PR to support")
case kFlagFunction2:
function := structure.ReadString(rd)
log.Debugf("function: %s", function)
e := entry.NewEntry()
e.Argv = []string{"function", "load", function}
ld.ch <- e
case kFlagModuleAux:
moduleId := structure.ReadLength(rd) // module id
moduleName := types.ModuleTypeNameByID(moduleId)