Skip to content

Commit

Permalink
added socket-io impl
Browse files Browse the repository at this point in the history
  • Loading branch information
Amith Koujalgi committed Oct 18, 2023
1 parent b26067c commit 625c79a
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions sys_stats/socketio_impl/main.py
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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=''))
Expand Down

0 comments on commit 625c79a

Please sign in to comment.