]> granicus.if.org Git - python/commit
SF Patch #102980, by Luke Kenneth Casson Leighton: BaseServer class
authorGuido van Rossum <guido@python.org>
Fri, 19 Jan 2001 00:44:41 +0000 (00:44 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 19 Jan 2001 00:44:41 +0000 (00:44 +0000)
commit90cb9067b82509ed4917084ffa85abc150509ff5
tree37b14b9abe4c3296913a75ca1b48fd5995b585ff
parent3fa560b343f97ec90d1ba18facdcf2515754ae69
SF Patch #102980, by Luke Kenneth Casson Leighton: BaseServer class
for SocketServer.py (inherited by TCPServer)

Luke wrote:

  The socketserver code, with a little bit of tweaking, can be made
  sufficiently general to service "requests" of any kind, not just by sockets.
  The BaseServer class was created, for example, to poll a table in a MYSQL
  database every 2 seconds. each entry in the table can be allocated a
  Handler which deals with the entry.

  With this patch, using BaseServer and ThreadedServer classes, the creation
  of the server that reads and handles MySQL table entries instead of a
  socket was utterly trivial: about 50 lines of python code.

  You may consider this code to be utterly useless [why would anyone else
  want to do anything like this???] - you are entitled to your opinion. if you
  think so, then think of this: have you considered how to cleanly add SSL to
  the TCPSocketServer? What about using shared memory as the
  communications mechanism for a server, instead of sockets? What about
  communication using files?

  The SocketServer code is extremely good every useful. it's just that as it
  stands, it is tied to sockets, which is not as useful.

I heartily approve of this idea.
Lib/SocketServer.py