MCPcopy Create free account
hub / github.com/RedisGears/RedisGears / callNext

Function callNext

plugins/python/redisgears_python.c:4655–4677  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4653}
4654
4655static PyObject* callNext(PyObject *cls, PyObject *args){
4656 PythonThreadCtx* ptctx = GetPythonThreadCtx();
4657 RedisGears_LockHanlderAcquire(staticCtx);
4658
4659 CommandReaderTriggerCtx* crtCtx = getCommandReaderTriggerCtx(ptctx);;
4660
4661 if(!crtCtx){
4662 PyErr_SetString(GearsError, "Can not get CommandHook ctx");
4663 RedisGears_LockHanlderRelease(staticCtx);
4664 return NULL;
4665 }
4666
4667 RedisModuleString** arguments = createArgs(args);
4668
4669 RedisModuleCallReply* reply = RedisGears_CommandReaderTriggerCtxNext(crtCtx, arguments, array_len(arguments));
4670
4671 PyObject* res = createReply(reply);
4672
4673 array_free_ex(arguments, RedisModule_FreeString(NULL, *(RedisModuleString**)ptr));
4674
4675 RedisGears_LockHanlderRelease(staticCtx);
4676 return res;
4677}
4678
4679PyMethodDef EmbRedisGearsMethods[] = {
4680 {"gearsCtx", gearsCtx, METH_VARARGS, "creating an empty gears context"},

Callers

nothing calls this directly

Calls 5

GetPythonThreadCtxFunction · 0.85
createArgsFunction · 0.85
array_lenFunction · 0.85
createReplyFunction · 0.85

Tested by

no test coverage detected