I have one server daemon (written on python) interacted with several clients on other machines through TCP/IP sockets. Every client is sending some stat information to the server every sec.
I try to find way show this stat information on web (using Django, for example).
Now I know only 2 not simple potential ways:
- using DB for temporaly storage (bad for perfomance);
- web interface on every request is connecting to the daemon through socket, like other clients and get this collected stat info;
Web server and daemon are located on the same machine.
Is there way to have access from web interface to operative data inside server daemon? May be exists any patterns to do this?
Code of daemon:
class Server(asyncore.dispatcher):
def __init__(self, address):
asyncore.dispatcher.__init__(self)
self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
self.bind(address)
self.listen(5)
def handle_close(self):
self.close()
def handle_accept(self):
conn, addr = self.accept()
channels.append(Channel(self, conn, addr))