| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- import asyncio
- import time
-
- import redis
-
- import os
- import copy
- import json
-
- import traceback
- import inspect
-
-
- '''
- umod
- # '''
-
- p=print
-
- async def anop(*a,**kw):pass
- def nop(*a,**kw):pass
-
- def connect_redis():
- return redis.Redis(host='localhost', port=6379, db=0,charset="utf-8", decode_responses=True, encoding_errors="backslashreplace")
-
-
- '''
- # '''
-
-
- # GCLMixin
- class globCL():
- init_cnt = 0
- def __init__(self,*a,**kw):
- # for now we are not going to do any weird class stuff
- cls = self.__class__
- cls.init_cnt += 1
- self.r = connect_redis()
- pass
- async def persistent_loop(self,*a,**kw):
- pass
- def run_persistent_loop(self,*a,**kw):
- pass
-
-
- # p("300 globCL.init_cnt:",globCL.init_cnt)
- glob_cl = globCL()
- # p("400 globCL.init_cnt:",globCL.init_cnt)
- # glob_cl_b = globCL()
- # p("501 globCL.init_cnt:",globCL.init_cnt)
-
- # print("..",end="\n",flush=True)
-
-
-
-
-
-
-
-
-
-
-
- def redis_info():
- rconn = glob_cl.r
- keys = rconn.keys()
- for k in keys:
- p(":",k)
-
- p("len(keys)",len(keys))
- print("",end="",flush=True)
- rconn.flushall()
- redis_info()
- r"""
-
- def atexit_fn():
- pass
- # rconn.flushall()
- print("ATEXIT FN")
- rinfo_len()
- keys = rconn.keys()
- print(keys)
- print(len(keys))
- print("t 000")
- # time.sleep(10)
- print("t 010")
- # time.sleep(20)
- print("t 020")
- print("ATEXIT FN...")
- rconn.flushall()
- atexit.register(atexit_fn)
-
-
-
- # """
|