From 625c79a45c7b7395af330bf53e0790181dde2885 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Wed, 18 Oct 2023 14:56:04 +0530 Subject: [PATCH] added socket-io impl --- sys_stats/socketio_impl/main.py | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/sys_stats/socketio_impl/main.py b/sys_stats/socketio_impl/main.py index 8b91ff9..2da3c28 100644 --- a/sys_stats/socketio_impl/main.py +++ b/sys_stats/socketio_impl/main.py @@ -1,10 +1,9 @@ import os -import threading -import time from pathlib import Path import eventlet import socketio + import sys_stats from sys_stats.api import stats @@ -22,18 +21,6 @@ def connect(sid, environ): print('Client connected:', sid) -@sio.on('my-action') -def my_action(sid, data): - print('Received message:', data) - - -def watcher(client): - while True: - print('watching') - client.emit("process-list", stats.processes(search_keyword='')) - time.sleep(1) - - @sio.on('list_processes') def list_processes(sid, data): sio.emit("process-list", stats.processes(search_keyword=''))