Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem: zpoller docs isn't mentioning file handles #2028

Merged
merged 2 commits into from
Oct 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions api/python_cffi.slurp
Original file line number Diff line number Diff line change
Expand Up @@ -2253,7 +2253,8 @@ void
zpoller_destroy (zpoller_t **self_p);

// 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, or a zactor_t instance.
// be a libzmq void * socket, a zsock_t instance, a zactor_t instance or a
// file handle.
int
zpoller_add (zpoller_t *self, void *reader);

Expand All @@ -2270,14 +2271,15 @@ void
zpoller_set_nonstop (zpoller_t *self, bool nonstop);

// Poll the registered readers for I/O, return first reader that has input.
// The reader will be a libzmq void * socket, or a zsock_t or zactor_t
// instance 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.
// 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.
void *
zpoller_wait (zpoller_t *self, int timeout);

Expand Down
20 changes: 11 additions & 9 deletions api/zpoller.api
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@

<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, or a zactor_t instance.
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>
Expand All @@ -45,14 +46,15 @@

<method name = "wait">
Poll the registered readers for I/O, return first reader that has input.
The reader will be a libzmq void * socket, or a zsock_t or zactor_t
instance 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.
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>
Expand Down
40 changes: 22 additions & 18 deletions bindings/delphi/CZMQ.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1326,7 +1326,8 @@ interface
IZpoller = interface

// 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, or a zactor_t instance.
// be a libzmq void * socket, a zsock_t instance, a zactor_t instance or a
// file handle.
function Add(const Reader: IZSock): Integer;

// Remove a reader from the poller; returns 0 if OK, -1 on failure. The reader
Expand All @@ -1340,14 +1341,15 @@ interface
procedure SetNonstop(Nonstop: Boolean);

// Poll the registered readers for I/O, return first reader that has input.
// The reader will be a libzmq void * socket, or a zsock_t or zactor_t
// instance 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.
// 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.
function Wait(Timeout: Integer): IZSock;

// Return true if the last zpoller_wait () call ended because the timeout
Expand Down Expand Up @@ -4087,7 +4089,8 @@ TZpoller = class(TInterfacedObject, IZpoller)
protected

// 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, or a zactor_t instance.
// be a libzmq void * socket, a zsock_t instance, a zactor_t instance or a
// file handle.
function Add(const Reader: IZSock): Integer;

// Remove a reader from the poller; returns 0 if OK, -1 on failure. The reader
Expand All @@ -4101,14 +4104,15 @@ TZpoller = class(TInterfacedObject, IZpoller)
procedure SetNonstop(Nonstop: Boolean);

// Poll the registered readers for I/O, return first reader that has input.
// The reader will be a libzmq void * socket, or a zsock_t or zactor_t
// instance 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.
// 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.
function Wait(Timeout: Integer): IZSock;

// Return true if the last zpoller_wait () call ended because the timeout
Expand Down
20 changes: 11 additions & 9 deletions bindings/delphi/libczmq.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1876,7 +1876,8 @@ interface
procedure zpoller_destroy(var self: PZpoller); cdecl; external lib_czmq {$IFDEF MSWINDOWS}delayed{$ENDIF};

// 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, or a zactor_t instance.
// be a libzmq void * socket, a zsock_t instance, a zactor_t instance or a
// file handle.
function zpoller_add(self: PZpoller; Reader: PZSock): Integer; cdecl; external lib_czmq {$IFDEF MSWINDOWS}delayed{$ENDIF};

// Remove a reader from the poller; returns 0 if OK, -1 on failure. The reader
Expand All @@ -1890,14 +1891,15 @@ interface
procedure zpoller_set_nonstop(self: PZpoller; Nonstop: Boolean); cdecl; external lib_czmq {$IFDEF MSWINDOWS}delayed{$ENDIF};

// Poll the registered readers for I/O, return first reader that has input.
// The reader will be a libzmq void * socket, or a zsock_t or zactor_t
// instance 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.
// 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.
function zpoller_wait(self: PZpoller; Timeout: Integer): PZSock; cdecl; external lib_czmq {$IFDEF MSWINDOWS}delayed{$ENDIF};

// Return true if the last zpoller_wait () call ended because the timeout
Expand Down
20 changes: 11 additions & 9 deletions bindings/jni/czmq-jni/src/main/java/org/zeromq/czmq/Zpoller.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ public void close () {
}
/*
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, or a zactor_t instance.
be a libzmq void * socket, a zsock_t instance, a zactor_t instance or a
file handle.
*/
native static int __add (long self, long reader);
public int add (long reader) {
Expand All @@ -76,14 +77,15 @@ public void setNonstop (boolean nonstop) {
}
/*
Poll the registered readers for I/O, return first reader that has input.
The reader will be a libzmq void * socket, or a zsock_t or zactor_t
instance 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.
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.
*/
native static long __wait (long self, int timeout);
public long Wait (int timeout) {
Expand Down
20 changes: 11 additions & 9 deletions bindings/lua_ffi/czmq_ffi.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2248,7 +2248,8 @@ void
zpoller_destroy (zpoller_t **self_p);

// 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, or a zactor_t instance.
// be a libzmq void * socket, a zsock_t instance, a zactor_t instance or a
// file handle.
int
zpoller_add (zpoller_t *self, void *reader);

Expand All @@ -2265,14 +2266,15 @@ void
zpoller_set_nonstop (zpoller_t *self, bool nonstop);

// Poll the registered readers for I/O, return first reader that has input.
// The reader will be a libzmq void * socket, or a zsock_t or zactor_t
// instance 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.
// 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.
void *
zpoller_wait (zpoller_t *self, int timeout);

Expand Down
3 changes: 2 additions & 1 deletion bindings/nodejs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2167,7 +2167,8 @@ integer my_zpoller.add (Zsock)
```

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, or a zactor_t instance.
be a libzmq void * socket, a zsock_t instance, a zactor_t instance or a
file handle.

```
nothing my_zpoller.setNonstop (Boolean)
Expand Down
20 changes: 11 additions & 9 deletions bindings/python/czmq/_czmq_ctypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4844,7 +4844,8 @@ def __nonzero__(self):
def add(self, reader):
"""
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, or a zactor_t instance.
be a libzmq void * socket, a zsock_t instance, a zactor_t instance or a
file handle.
"""
return lib.zpoller_add(self._as_parameter_, reader)

Expand All @@ -4867,14 +4868,15 @@ def set_nonstop(self, nonstop):
def wait(self, timeout):
"""
Poll the registered readers for I/O, return first reader that has input.
The reader will be a libzmq void * socket, or a zsock_t or zactor_t
instance 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.
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.
"""
return c_void_p(lib.zpoller_wait(self._as_parameter_, timeout))

Expand Down
20 changes: 11 additions & 9 deletions bindings/python_cffi/czmq_cffi/Zpoller.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ def __init__(self, reader, *reader_args):
def add(self, reader):
"""
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, or a zactor_t instance.
be a libzmq void * socket, a zsock_t instance, a zactor_t instance or a
file handle.
"""
return utils.lib.zpoller_add(self._p, reader._p)

Expand All @@ -52,14 +53,15 @@ def set_nonstop(self, nonstop):
def wait(self, timeout):
"""
Poll the registered readers for I/O, return first reader that has input.
The reader will be a libzmq void * socket, or a zsock_t or zactor_t
instance 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.
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.
"""
return utils.lib.zpoller_wait(self._p, timeout)

Expand Down
20 changes: 11 additions & 9 deletions bindings/python_cffi/czmq_cffi/cdefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2255,7 +2255,8 @@
zpoller_destroy (zpoller_t **self_p);

// 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, or a zactor_t instance.
// be a libzmq void * socket, a zsock_t instance, a zactor_t instance or a
// file handle.
int
zpoller_add (zpoller_t *self, void *reader);

Expand All @@ -2272,14 +2273,15 @@
zpoller_set_nonstop (zpoller_t *self, bool nonstop);

// Poll the registered readers for I/O, return first reader that has input.
// The reader will be a libzmq void * socket, or a zsock_t or zactor_t
// instance 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.
// 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.
void *
zpoller_wait (zpoller_t *self, int timeout);

Expand Down
Loading