Created
August 10, 2013 03:35
-
-
Save victorarias/6198945 to your computer and use it in GitHub Desktop.
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
class Connection | |
# .. rest of the class .. # | |
def accept_connection(io) | |
@io = io | |
# new connection code | |
end | |
def to_io | |
@io | |
end | |
end | |
class Reactor | |
# array_of_connections_to_read is an array of instances of the above Connection class | |
# array_of_connections_to_write is an array of instances of the above Connection class | |
def tick | |
to_read, to_write = IO.select(array_of_connections_to_read, array_of_connections_to_write) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment