Skip to content

Commit de369ff

Browse files
author
DvirDukhan
committed
added command_parser.h
1 parent 18a975c commit de369ff

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/execution/command_parser.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#pragma once
2+
3+
#include "redismodule.h"
4+
#include "run_info.h"
5+
6+
typedef enum RunCommand {
7+
CMD_MODELRUN = 0,
8+
CMD_SCRIPTRUN,
9+
CMD_DAGRUN,
10+
CMD_MODELEXECUTE,
11+
CMD_SCRIPTEXECUTE,
12+
CMD_DAGEXECUTE
13+
} RunCommand;
14+
15+
/**
16+
* @brief Parse and execute RedisAI run command. After parsing and validation, the resulted
17+
* runInfo (DAG) is queued and the client is blocked until the execution is complete (async
18+
* execution).
19+
* @return Returns REDISMODULE_OK if the command is valid, REDISMODULE_ERR otherwise.
20+
*/
21+
int RedisAI_ExecuteCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int argc,
22+
RunCommand command, bool ro_dag);

0 commit comments

Comments
 (0)