class Puma::Reactor
def add(c)
so that the first element to timeout will be at the front of the
it is added to a `@timeouts` array. This array is then re-arranged
If the object passed in has a timeout value in `timeout_at` then
pull the contents from `@input` and add them to the sockets array.
the `NIO::Selector#select` and then there is logic to detect the value of `*`,
This behavior is accomplished by writing to `@trigger` which wakes up
right away.
object can be read immediately, it does not block, but instead returns
another call to `NIO::Selector#select` needs to happen. Since the `Puma::Client`
the contents of `@input` added to the `sockets` array, and then
Instead what needs to happen is that `NIO::Selector#select` needs to be woken up,
the `NIO::Selector#select` will not be watching for it yet.
reactor it cannot be added directly to the `sockets` array, because
will sleep on `NIO::Selector#select`. When a new connection is added to the
The main body of the reactor loop is in `run_internal` and it
object.
is usually a `Puma::Client` object that responds like an IO
Typically called by `Puma::Server` the value passed in
This method adds a connection to the reactor
def add(c) @mutex.synchronize do @input << c @trigger << "*" end end