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

Function TimeEvent_Free

plugins/python/redisgears_python.c:4477–4488  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4475}
4476
4477static void TimeEvent_Free(void *value){
4478 TimerData* td = value;
4479 PythonExecutionCtx pectx = PythonExecutionCtx_New(td->session, NULL);
4480 RedisGearsPy_Lock(&pectx);
4481 GearsPyDecRef(td->callback);
4482 RedisGearsPy_Unlock(&pectx);
4483 RedisModuleCtx* ctx = RedisModule_GetThreadSafeContext(NULL);
4484 RedisModule_StopTimer(ctx, td->id, NULL);
4485 PythonSessionCtx_Free(td->session);
4486 RedisModule_FreeThreadSafeContext(ctx);
4487 RG_FREE(td);
4488}
4489
4490static int TimeEvent_RegisterType(RedisModuleCtx* ctx){
4491 RedisModuleTypeMethods tm = {.version = REDISMODULE_TYPE_METHOD_VERSION,

Callers 1

gearsTimeEventFunction · 0.85

Calls 4

RedisGearsPy_LockFunction · 0.85
GearsPyDecRefFunction · 0.85
RedisGearsPy_UnlockFunction · 0.85
PythonSessionCtx_FreeFunction · 0.85

Tested by

no test coverage detected