In Files

Namespace

Class/Module Index [+]

Quicksearch

ZMQ

Ruby interface to the zeromq messaging library.

Public Class Methods

select(in, out=[], err=[], timeout=nil) → [in, out, err] | nil click to toggle source

Like IO.select, but also works with 0MQ sockets.

static VALUE module_select (int argc_, VALUE* argv_, VALUE self_)
{
    VALUE readset, writeset, errset, timeout;
    rb_scan_args (argc_, argv_, "13", &readset, &writeset, &errset, &timeout);

    long timeout_usec;

    if (!NIL_P (readset)) Check_Type (readset, T_ARRAY);
    if (!NIL_P (writeset)) Check_Type (writeset, T_ARRAY);
    if (!NIL_P (errset)) Check_Type (errset, T_ARRAY);
    
    if (NIL_P (timeout))
        timeout_usec = -1;
    else
        timeout_usec = (long)(NUM2DBL (timeout) * 1000000);

    return module_select_internal(readset, writeset, errset, timeout_usec);
}
version() → [major, minor, patch] click to toggle source

Returns the version of the zeromq library.

static VALUE module_version (VALUE self_)
{
    int major, minor, patch;
    
    zmq_version(&major, &minor, &patch);
    
    return rb_ary_new3 (3, INT2NUM (major), INT2NUM (minor), INT2NUM (patch));
}

[Validate]

Generated with the Darkfish Rdoc Generator 2.