You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
588 B
21 lines
588 B
import time
|
|
|
|
from Server import Server
|
|
from Event.EventThread import EventThread
|
|
|
|
class ThreadedServer(Server):
|
|
def __init__(self, application, threads = 1):
|
|
super(ThreadedServer, self).__init__(application)
|
|
self._threads = []
|
|
|
|
for num in range(1, threads):
|
|
self._threads.append(
|
|
EventThread(self._dispatcher, 'th' + str(num)))
|
|
|
|
def start(self, heartbeat = None):
|
|
for thread in self._threads:
|
|
thread.start()
|
|
|
|
super(ThreadedServer, self).start(heartbeat)
|
|
|
|
# vim: set ft=python et ts=8 sw=4 sts=4:
|