File: zpoller.api

package info (click to toggle)
czmq 4.2.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,912 kB
  • sloc: ansic: 30,811; cpp: 19,362; sh: 11,873; python: 11,814; pascal: 11,229; ruby: 8,818; java: 4,363; makefile: 299; perl: 151; javascript: 35
file content (73 lines) | stat: -rw-r--r-- 3,125 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<class name = "zpoller" state = "stable">
    <!--
    Copyright (c) the Contributors as noted in the AUTHORS file.
    This file is part of CZMQ, the high-level C binding for 0MQ:
    http://czmq.zeromq.org.

    This Source Code Form is subject to the terms of the Mozilla Public
    License, v. 2.0. If a copy of the MPL was not distributed with this
    file, You can obtain one at http://mozilla.org/MPL/2.0/.
    -->
    event-driven reactor

    <constructor>
        Create new poller, specifying zero or more readers. The list of
        readers ends in a NULL. Each reader can be a zsock_t instance, a
        zactor_t instance, a libzmq socket (void *), or a file handle.
        <argument name = "reader" type = "sockish" variadic = "1" />
    </constructor>

    <destructor>
        Destroy a poller
    </destructor>

    <method name = "add">
        Add a reader to be polled. Returns 0 if OK, -1 on failure. The reader may
        be a libzmq void * socket, a zsock_t instance, a zactor_t instance or a
        file handle.
        <argument name = "reader" type = "sockish" />
        <return type = "integer" />
    </method>

    <method name = "remove">
        Remove a reader from the poller; returns 0 if OK, -1 on failure. The reader
        must have been passed during construction, or in an zpoller_add () call.
        <argument name = "reader" type = "anything" />
        <return type = "integer" />
    </method>

    <method name = "set nonstop" >
        By default the poller stops if the process receives a SIGINT or SIGTERM
        signal. This makes it impossible to shut-down message based architectures
        like zactors. This method lets you switch off break handling. The default
        nonstop setting is off (false).
        <argument name = "nonstop" type = "boolean" />
    </method>

    <method name = "wait">
        Poll the registered readers for I/O, return first reader that has input.
        The reader will be a libzmq void * socket, a zsock_t, a zactor_t
        instance or a file handle as specified in zpoller_new/zpoller_add. The 
        timeout should be zero or greater, or -1 to wait indefinitely. Socket 
        priority is defined by their order in the poll list. If you need a 
        balanced poll, use the low level zmq_poll method directly. If the poll 
        call was interrupted (SIGINT), or the ZMQ context was destroyed, or the 
        timeout expired, returns NULL. You can test the actual exit condition by 
        calling zpoller_expired () and zpoller_terminated (). The timeout is in 
        msec.
        <argument name = "timeout" type = "integer" />
        <return type = "sockish" />
    </method>

    <method name = "expired">
        Return true if the last zpoller_wait () call ended because the timeout
        expired, without any error.
        <return type = "boolean" />
    </method>

    <method name = "terminated">
        Return true if the last zpoller_wait () call ended because the process
        was interrupted, or the parent context was destroyed.
        <return type = "boolean" />
    </method>
</class>