Class Coolio::Loop
In: lib/cool.io/loop.rb
Parent: Object

Methods

attach   default   default   has_active_watchers?   new   run   stop   watchers  

Constants

EVFLAG_NOENV = 0x1000000  
EVFLAG_FORKCHECK = 0x2000000
EVBACKEND_SELECT = 0x00000001
EVBACKEND_POLL = 0x00000002
EVBACKEND_EPOLL = 0x00000004
EVBACKEND_KQUEUE = 0x00000008
EVBACKEND_PORT = 0x00000020

Public Class methods

Retrieve the default event loop

Retrieve the default event loop for the current thread

Create a new Coolio::Loop

Options:

:skip_environment (boolean)

  Ignore the $LIBEV_FLAGS environment variable

:fork_check (boolean)

  Enable autodetection of forks

:backend

  Choose the default backend, one (or many in an array) of:
    :select (most platforms)
    :poll   (most platforms except Windows)
    :epoll  (Linux)
    :kqueue (BSD/Mac OS X)
    :port   (Solaris 10)

Public Instance methods

Attach a watcher to the loop

Does the loop have any active watchers?

Run the event loop and dispatch events back to Ruby. If there are no watchers associated with the event loop it will return immediately. Otherwise, run will continue blocking and making event callbacks to watchers until all watchers associated with the loop have been disabled or detached. The loop may be explicitly stopped by calling the stop method on the loop object.

Stop the event loop if it‘s running

All watchers attached to the current loop

[Validate]