hub.py 1.5 KB

123456789101112131415161718192021222324252627282930
  1. import sys
  2. import importlib
  3. sys.path.append('../sri-pysdk')
  4. methods = importlib.import_module(f"xlib")
  5. class Global(object):
  6. # --- 中间件服务器 ---
  7. emqx001 = importlib.import_module(f"xclient.xmqtt").Client(host='127.0.0.1', port=41883)
  8. emqx002 = importlib.import_module(f"xclient.xmqtt").Client(host='127.0.0.1', port=41883)
  9. aps = importlib.import_module(f"xpip.xapscheduler").APS(db_type='mongo',
  10. db_host='127.0.0.1',
  11. db_port=47017,
  12. username='admin', password='admin',
  13. database='bg', collection='LoopTask')
  14. # --- 业务数据数据库 ---
  15. mdb = importlib.import_module(f"xclient.xmongo").Client(host='127.0.0.1', port=47017, database='bg',
  16. username='admin', password='admin')
  17. # emqx = importlib.import_module(f"xclient.xmqtt").Client(host='10.10.10.73', port=41883)
  18. # aps = importlib.import_module(f"xpip.xapscheduler").APS(db_type='mongo',
  19. # db_host='10.10.10.73',
  20. # db_port=47017,
  21. # username='admin', password='admin',
  22. # database='bg', collection='LoopTask')