This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'socket' | |
require 'thread' | |
# Example of a "threaded preforking" server using multiple acceptor threads | |
# and a pool of worker threads to service the actual requests. Note | |
# that this is similar to a real preforking server that uses Kernel#fork | |
# to service requests concurrently with a single listener socket. The only | |
# difference is that instead of multiple forked processes, we use multiple | |
# acceptor threads. | |
class Server |