Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-10 08:38:58

0001 from pandajedi.jediconfig import jedi_config
0002 from pandajedi.jedicore import Interaction
0003 
0004 
0005 # interface to JediTaskBuffer
0006 class JediTaskBufferInterface:
0007     # constructor
0008     def __init__(self):
0009         self.interface = None
0010 
0011     # setup interface
0012     def setupInterface(self, max_size=None):
0013         vo = "any"
0014         maxSize = max_size if max_size is not None else jedi_config.db.nWorkers
0015         moduleName = "pandajedi.jedicore.JediTaskBuffer"
0016         className = "JediTaskBuffer"
0017         self.interface = Interaction.CommandSendInterface(vo, maxSize, moduleName, className)
0018         self.interface.initialize()
0019 
0020     # method emulation
0021     def __getattr__(self, attrName):
0022         return getattr(self.interface, attrName)
0023 
0024 
0025 if __name__ == "__main__":
0026 
0027     def dummyClient(dif, stime):
0028         print("client test")
0029         import time
0030 
0031         for i in range(3):
0032             # time.sleep(i*stime)
0033             try:
0034                 print(dif.getCloudList())
0035             except Exception:
0036                 print("exp")
0037         print("client done")
0038 
0039     dif = JediTaskBufferInterface()
0040     dif.setupInterface()
0041     print("master test")
0042     print(dif.getCloudList())
0043     print("master done")
0044     import multiprocessing
0045 
0046     pList = []
0047     for i in range(5):
0048         p = multiprocessing.Process(target=dummyClient, args=(dif, i))
0049         pList.append(p)
0050         p.start()