Class Rev::Loop
In: lib/rev/loop.rb
ext/rev/rev_buffer.c
Parent: Object

Rev::TimerWatcher lets you create either one-shot or periodic timers which run within Rev‘s event loop. It‘s useful for creating timeouts or events which fire periodically.

Methods

attach   default   ev_loop_new   new   new   run   run_nonblock   run_once   stop  

Constants

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

Attributes

watchers  [R] 

Public Class methods

Retrieve the default event loop for the current thread

Create a new Rev::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)

Method implementations

Public Instance methods

Attach a watcher to the loop

Wrapper for populating a Rev_Loop struct with a new event loop

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.

Run the Rev::Loop once, but return immediately if there are no pending events.

Run the Rev::Loop once, blocking until events are received.

Stop the event loop if it‘s running

[Validate]