[Zope-Checkins] CVS: Zope3 - z3.py:1.1.2.9
Shane Hathaway
shane@digicool.com
Mon, 26 Nov 2001 11:20:35 -0500
Update of /cvs-repository/Zope3
In directory cvs.zope.org:/tmp/cvs-serv24636
Modified Files:
Tag: Zope-3x-branch
z3.py
Log Message:
Switched to new HTTP server.
=== Zope3/z3.py 1.1.2.8 => 1.1.2.9 ===
BrowserResponsePayload
from Zope.App.OFS.RootFolder import RootFolder
-import Zope.Server, asyncore, zLOG
+import asyncore, zLOG
+from Zope.Server.PublisherServers import PublisherHTTPServer
+from Zope.Server.TaskThreads import ThreadedTaskDispatcher
# temp hack
from Zope.App.config import config
config(os.getcwd())
-Zope.Server.setNumberOfThreads(4)
-
class App(RootFolder):
""" """
def __call__(self, URL):
@@ -42,11 +42,15 @@
zLOG._set_log_dest(sys.stderr)
-server = Zope.Server.zhttp_server('', 8080)
publication = BrowserPublication(App())
request_payload = BrowserRequestPayload(publication)
response_payload = BrowserResponsePayload()
-handler = Zope.Server.zhttp_handler(request_payload, response_payload, '', {})
-server.install_handler(handler)
+
+tasks = ThreadedTaskDispatcher()
+tasks.setThreadCount(4)
+
+PublisherHTTPServer(request_payload, response_payload,
+ '', 8080, tasks=tasks)
+
asyncore.loop()
sys.exit(0)