Changeset 21136 in project


Ignore:
Timestamp:
10/30/10 18:56:44 (11 years ago)
Author:
Moritz Heidkamp
Message:

zmq: add documentation for polling api

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/zmq

    r21135 r21136  
    183183message is available (default: {{#f}}).
    184184
     185
     186==== Polling
     187
     188<procedure>(make-poll-item socket/fd #!key in out)</procedure>
     189
     190Create a ZeroMQ {{poll-item}} for {{socket/fd}} which can either be a
     191ZeroMQ socket or a POSIX file descriptor. The keyword arguments {{in}}
     192and {{out}} are booleans indicating whether the item should poll for
     193incoming or outgoing data. Both are {{#f}} by default so make sure to
     194pass at least one as {{#t}}.
     195
     196
     197<procedure>(poll-item-fd item)</procedure>
     198
     199Return {{item}}'s POSIX file descriptor if is has been created with
     200one (see {{make-poll-item}}).
     201
     202
     203<procedure>(poll-item-socket item)</procedure>
     204
     205Return {{item}}'s socket if is has been created with one (see
     206{{make-poll-item}}).
     207
     208
     209<procedure>(poll-item-in? item)</procedure>
     210
     211Check whether {{item}}'s socket or file descriptor is ready for reading.
     212
     213
     214<procedure>(poll-item-out? item)</procedure>
     215
     216Check whether {{item}}'s socket or file descriptor is ready for writing.
     217
     218
     219<procedure>(poll-item-error? item)</procedure>
     220
     221Check whether there is an error condition present on {{item}}'s file
     222descriptor. This will never be the case for ZeroMQ sockets.
     223
     224
     225<procedure>(poll poll-items timeout/block)</procedure>
     226
     227Poll the poll-item list {{poll-items}} for activity. {{timeout/block}}
     228can either be {{#t}} which will block until one of the {{poll-items}}
     229is ready. When {{#f}} is passed the call will not block and return
     230{{#f}} when no {{poll-item}} is ready. Alternatively, an integer may
     231be passed, indicating the number of microseconds to wait for activity.
     232
     233The return value is a number indicating how many {{poll-items}} are
     234ready.
     235
    185236=== License
    186237
Note: See TracChangeset for help on using the changeset viewer.