czmq-ffi-gen 0.13.0 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +8 -0
- data/lib/czmq-ffi-gen/czmq/ffi/zactor.rb +40 -7
- data/lib/czmq-ffi-gen/czmq/ffi/zargs.rb +259 -0
- data/lib/czmq-ffi-gen/czmq/ffi/zarmour.rb +3 -3
- data/lib/czmq-ffi-gen/czmq/ffi/zcert.rb +15 -6
- data/lib/czmq-ffi-gen/czmq/ffi/zcertstore.rb +25 -11
- data/lib/czmq-ffi-gen/czmq/ffi/zchunk.rb +18 -18
- data/lib/czmq-ffi-gen/czmq/ffi/zclock.rb +6 -6
- data/lib/czmq-ffi-gen/czmq/ffi/zconfig.rb +27 -17
- data/lib/czmq-ffi-gen/czmq/ffi/zdigest.rb +4 -4
- data/lib/czmq-ffi-gen/czmq/ffi/zdir.rb +36 -36
- data/lib/czmq-ffi-gen/czmq/ffi/zdir_patch.rb +1 -1
- data/lib/czmq-ffi-gen/czmq/ffi/zfile.rb +27 -19
- data/lib/czmq-ffi-gen/czmq/ffi/zframe.rb +22 -21
- data/lib/czmq-ffi-gen/czmq/ffi/zhash.rb +54 -54
- data/lib/czmq-ffi-gen/czmq/ffi/zhashx.rb +82 -80
- data/lib/czmq-ffi-gen/czmq/ffi/ziflist.rb +30 -0
- data/lib/czmq-ffi-gen/czmq/ffi/zlist.rb +30 -30
- data/lib/czmq-ffi-gen/czmq/ffi/zlistx.rb +44 -44
- data/lib/czmq-ffi-gen/czmq/ffi/zloop.rb +39 -39
- data/lib/czmq-ffi-gen/czmq/ffi/zmsg.rb +46 -46
- data/lib/czmq-ffi-gen/czmq/ffi/zpoller.rb +16 -16
- data/lib/czmq-ffi-gen/czmq/ffi/zproc.rb +237 -34
- data/lib/czmq-ffi-gen/czmq/ffi/zsock.rb +1201 -973
- data/lib/czmq-ffi-gen/czmq/ffi/zstr.rb +58 -19
- data/lib/czmq-ffi-gen/czmq/ffi/zsys.rb +836 -0
- data/lib/czmq-ffi-gen/czmq/ffi/ztimerset.rb +6 -6
- data/lib/czmq-ffi-gen/czmq/ffi/ztrie.rb +10 -10
- data/lib/czmq-ffi-gen/czmq/ffi/zuuid.rb +4 -4
- data/lib/czmq-ffi-gen/czmq/ffi.rb +224 -698
- data/lib/czmq-ffi-gen/gem_version.rb +1 -1
- data/lib/czmq-ffi-gen/vendor.rb +9 -1
- metadata +5 -3
@@ -80,10 +80,10 @@ module CZMQ
|
|
80
80
|
__new ptr
|
81
81
|
end
|
82
82
|
|
83
|
-
# Receive message from socket, returns zmsg_t object or NULL if the recv
|
84
|
-
# was interrupted. Does a blocking recv. If you want to not block then use
|
83
|
+
# Receive message from socket, returns zmsg_t object or NULL if the recv
|
84
|
+
# was interrupted. Does a blocking recv. If you want to not block then use
|
85
85
|
# the zloop class or zmsg_recv_nowait or zmq_poll to check for socket input
|
86
|
-
# before receiving.
|
86
|
+
# before receiving.
|
87
87
|
# @param source [::FFI::Pointer, #to_ptr]
|
88
88
|
# @return [CZMQ::Zmsg]
|
89
89
|
def self.recv(source)
|
@@ -92,7 +92,7 @@ module CZMQ
|
|
92
92
|
end
|
93
93
|
|
94
94
|
# Load/append an open file into new message, return the message.
|
95
|
-
# Returns NULL if the message could not be loaded.
|
95
|
+
# Returns NULL if the message could not be loaded.
|
96
96
|
# @param file [::FFI::Pointer, #to_ptr]
|
97
97
|
# @return [CZMQ::Zmsg]
|
98
98
|
def self.load(file)
|
@@ -101,8 +101,8 @@ module CZMQ
|
|
101
101
|
end
|
102
102
|
|
103
103
|
# Decodes a serialized message frame created by zmsg_encode () and returns
|
104
|
-
# a new zmsg_t object. Returns NULL if the frame was badly formatted or
|
105
|
-
# there was insufficient memory to work.
|
104
|
+
# a new zmsg_t object. Returns NULL if the frame was badly formatted or
|
105
|
+
# there was insufficient memory to work.
|
106
106
|
# @param frame [Zframe, #__ptr]
|
107
107
|
# @return [CZMQ::Zmsg]
|
108
108
|
def self.decode(frame)
|
@@ -112,8 +112,8 @@ module CZMQ
|
|
112
112
|
end
|
113
113
|
|
114
114
|
# Generate a signal message encoding the given status. A signal is a short
|
115
|
-
# message carrying a 1-byte success/failure code (by convention, 0 means
|
116
|
-
# OK). Signals are encoded to be distinguishable from "normal" messages.
|
115
|
+
# message carrying a 1-byte success/failure code (by convention, 0 means
|
116
|
+
# OK). Signals are encoded to be distinguishable from "normal" messages.
|
117
117
|
# @param status [Integer, #to_int, #to_i]
|
118
118
|
# @return [CZMQ::Zmsg]
|
119
119
|
def self.new_signal(status)
|
@@ -134,8 +134,8 @@ module CZMQ
|
|
134
134
|
|
135
135
|
# Send message to destination socket, and destroy the message after sending
|
136
136
|
# it successfully. If the message has no frames, sends nothing but destroys
|
137
|
-
# the message anyhow. Nullifies the caller's reference to the message (as
|
138
|
-
# it is a destructor).
|
137
|
+
# the message anyhow. Nullifies the caller's reference to the message (as
|
138
|
+
# it is a destructor).
|
139
139
|
#
|
140
140
|
# @param self_p [#__ptr_give_ref]
|
141
141
|
# @param dest [::FFI::Pointer, #to_ptr]
|
@@ -146,12 +146,12 @@ module CZMQ
|
|
146
146
|
result
|
147
147
|
end
|
148
148
|
|
149
|
-
# Send message to destination socket as part of a multipart sequence, and
|
150
|
-
# destroy the message after sending it successfully. Note that after a
|
149
|
+
# Send message to destination socket as part of a multipart sequence, and
|
150
|
+
# destroy the message after sending it successfully. Note that after a
|
151
151
|
# zmsg_sendm, you must call zmsg_send or another method that sends a final
|
152
|
-
# message part. If the message has no frames, sends nothing but destroys
|
153
|
-
# the message anyhow. Nullifies the caller's reference to the message (as
|
154
|
-
# it is a destructor).
|
152
|
+
# message part. If the message has no frames, sends nothing but destroys
|
153
|
+
# the message anyhow. Nullifies the caller's reference to the message (as
|
154
|
+
# it is a destructor).
|
155
155
|
#
|
156
156
|
# @param self_p [#__ptr_give_ref]
|
157
157
|
# @param dest [::FFI::Pointer, #to_ptr]
|
@@ -183,7 +183,7 @@ module CZMQ
|
|
183
183
|
end
|
184
184
|
|
185
185
|
# Return message routing ID, if the message came from a ZMQ_SERVER socket.
|
186
|
-
# Else returns zero.
|
186
|
+
# Else returns zero.
|
187
187
|
#
|
188
188
|
# @return [Integer]
|
189
189
|
def routing_id()
|
@@ -194,7 +194,7 @@ module CZMQ
|
|
194
194
|
end
|
195
195
|
|
196
196
|
# Set routing ID on message. This is used if/when the message is sent to a
|
197
|
-
# ZMQ_SERVER socket.
|
197
|
+
# ZMQ_SERVER socket.
|
198
198
|
#
|
199
199
|
# @param routing_id [Integer, #to_int, #to_i]
|
200
200
|
# @return [void]
|
@@ -206,10 +206,10 @@ module CZMQ
|
|
206
206
|
result
|
207
207
|
end
|
208
208
|
|
209
|
-
# Push frame to the front of the message, i.e. before all other frames.
|
209
|
+
# Push frame to the front of the message, i.e. before all other frames.
|
210
210
|
# Message takes ownership of frame, will destroy it when message is sent.
|
211
|
-
# Returns 0 on success, -1 on error. Deprecates zmsg_push, which did not
|
212
|
-
# nullify the caller's frame reference.
|
211
|
+
# Returns 0 on success, -1 on error. Deprecates zmsg_push, which did not
|
212
|
+
# nullify the caller's frame reference.
|
213
213
|
#
|
214
214
|
# @param frame_p [#__ptr_give_ref]
|
215
215
|
# @return [Integer]
|
@@ -221,10 +221,10 @@ module CZMQ
|
|
221
221
|
result
|
222
222
|
end
|
223
223
|
|
224
|
-
# Add frame to the end of the message, i.e. after all other frames.
|
224
|
+
# Add frame to the end of the message, i.e. after all other frames.
|
225
225
|
# Message takes ownership of frame, will destroy it when message is sent.
|
226
|
-
# Returns 0 on success. Deprecates zmsg_add, which did not nullify the
|
227
|
-
# caller's frame reference.
|
226
|
+
# Returns 0 on success. Deprecates zmsg_add, which did not nullify the
|
227
|
+
# caller's frame reference.
|
228
228
|
#
|
229
229
|
# @param frame_p [#__ptr_give_ref]
|
230
230
|
# @return [Integer]
|
@@ -248,7 +248,7 @@ module CZMQ
|
|
248
248
|
end
|
249
249
|
|
250
250
|
# Push block of memory to front of message, as a new frame.
|
251
|
-
# Returns 0 on success, -1 on error.
|
251
|
+
# Returns 0 on success, -1 on error.
|
252
252
|
#
|
253
253
|
# @param data [::FFI::Pointer, #to_ptr]
|
254
254
|
# @param size [Integer, #to_int, #to_i]
|
@@ -262,7 +262,7 @@ module CZMQ
|
|
262
262
|
end
|
263
263
|
|
264
264
|
# Add block of memory to the end of the message, as a new frame.
|
265
|
-
# Returns 0 on success, -1 on error.
|
265
|
+
# Returns 0 on success, -1 on error.
|
266
266
|
#
|
267
267
|
# @param data [::FFI::Pointer, #to_ptr]
|
268
268
|
# @param size [Integer, #to_int, #to_i]
|
@@ -276,7 +276,7 @@ module CZMQ
|
|
276
276
|
end
|
277
277
|
|
278
278
|
# Push string as new frame to front of message.
|
279
|
-
# Returns 0 on success, -1 on error.
|
279
|
+
# Returns 0 on success, -1 on error.
|
280
280
|
#
|
281
281
|
# @param string [String, #to_s, nil]
|
282
282
|
# @return [Integer]
|
@@ -288,7 +288,7 @@ module CZMQ
|
|
288
288
|
end
|
289
289
|
|
290
290
|
# Push string as new frame to end of message.
|
291
|
-
# Returns 0 on success, -1 on error.
|
291
|
+
# Returns 0 on success, -1 on error.
|
292
292
|
#
|
293
293
|
# @param string [String, #to_s, nil]
|
294
294
|
# @return [Integer]
|
@@ -300,7 +300,7 @@ module CZMQ
|
|
300
300
|
end
|
301
301
|
|
302
302
|
# Push formatted string as new frame to front of message.
|
303
|
-
# Returns 0 on success, -1 on error.
|
303
|
+
# Returns 0 on success, -1 on error.
|
304
304
|
#
|
305
305
|
# @param format [String, #to_s, nil]
|
306
306
|
# @param args [Array<Object>] see https://github.com/ffi/ffi/wiki/examples#using-varargs
|
@@ -313,7 +313,7 @@ module CZMQ
|
|
313
313
|
end
|
314
314
|
|
315
315
|
# Push formatted string as new frame to end of message.
|
316
|
-
# Returns 0 on success, -1 on error.
|
316
|
+
# Returns 0 on success, -1 on error.
|
317
317
|
#
|
318
318
|
# @param format [String, #to_s, nil]
|
319
319
|
# @param args [Array<Object>] see https://github.com/ffi/ffi/wiki/examples#using-varargs
|
@@ -326,7 +326,7 @@ module CZMQ
|
|
326
326
|
end
|
327
327
|
|
328
328
|
# Pop frame off front of message, return as fresh string. If there were
|
329
|
-
# no more frames in the message, returns NULL.
|
329
|
+
# no more frames in the message, returns NULL.
|
330
330
|
#
|
331
331
|
# @return [::FFI::AutoPointer]
|
332
332
|
def popstr()
|
@@ -337,9 +337,9 @@ module CZMQ
|
|
337
337
|
result
|
338
338
|
end
|
339
339
|
|
340
|
-
# Push encoded message as a new frame. Message takes ownership of
|
340
|
+
# Push encoded message as a new frame. Message takes ownership of
|
341
341
|
# submessage, so the original is destroyed in this call. Returns 0 on
|
342
|
-
# success, -1 on error.
|
342
|
+
# success, -1 on error.
|
343
343
|
#
|
344
344
|
# @param msg_p [#__ptr_give_ref]
|
345
345
|
# @return [Integer]
|
@@ -352,7 +352,7 @@ module CZMQ
|
|
352
352
|
end
|
353
353
|
|
354
354
|
# Remove first submessage from message, if any. Returns zmsg_t, or NULL if
|
355
|
-
# decoding was not successful.
|
355
|
+
# decoding was not successful.
|
356
356
|
#
|
357
357
|
# @return [Zmsg]
|
358
358
|
def popmsg()
|
@@ -376,7 +376,7 @@ module CZMQ
|
|
376
376
|
end
|
377
377
|
|
378
378
|
# Set cursor to first frame in message. Returns frame, or NULL, if the
|
379
|
-
# message is empty. Use this to navigate the frames as a list.
|
379
|
+
# message is empty. Use this to navigate the frames as a list.
|
380
380
|
#
|
381
381
|
# @return [Zframe]
|
382
382
|
def first()
|
@@ -388,7 +388,7 @@ module CZMQ
|
|
388
388
|
end
|
389
389
|
|
390
390
|
# Return the next frame. If there are no more frames, returns NULL. To move
|
391
|
-
# to the first frame call zmsg_first(). Advances the cursor.
|
391
|
+
# to the first frame call zmsg_first(). Advances the cursor.
|
392
392
|
#
|
393
393
|
# @return [Zframe]
|
394
394
|
def next()
|
@@ -410,11 +410,11 @@ module CZMQ
|
|
410
410
|
result
|
411
411
|
end
|
412
412
|
|
413
|
-
# Save message to an open file, return 0 if OK, else -1. The message is
|
414
|
-
# saved as a series of frames, each with length and data. Note that the
|
415
|
-
# file is NOT guaranteed to be portable between operating systems, not
|
413
|
+
# Save message to an open file, return 0 if OK, else -1. The message is
|
414
|
+
# saved as a series of frames, each with length and data. Note that the
|
415
|
+
# file is NOT guaranteed to be portable between operating systems, not
|
416
416
|
# versions of CZMQ. The file format is at present undocumented and liable
|
417
|
-
# to arbitrary change.
|
417
|
+
# to arbitrary change.
|
418
418
|
#
|
419
419
|
# @param file [::FFI::Pointer, #to_ptr]
|
420
420
|
# @return [Integer]
|
@@ -426,10 +426,10 @@ module CZMQ
|
|
426
426
|
end
|
427
427
|
|
428
428
|
# Serialize multipart message to a single message frame. Use this method
|
429
|
-
# to send structured messages across transports that do not support
|
430
|
-
# multipart data. Allocates and returns a new frame containing the
|
431
|
-
# serialized message. To decode a serialized message frame, use
|
432
|
-
# zmsg_decode ().
|
429
|
+
# to send structured messages across transports that do not support
|
430
|
+
# multipart data. Allocates and returns a new frame containing the
|
431
|
+
# serialized message. To decode a serialized message frame, use
|
432
|
+
# zmsg_decode ().
|
433
433
|
#
|
434
434
|
# @return [Zframe]
|
435
435
|
def encode()
|
@@ -441,7 +441,7 @@ module CZMQ
|
|
441
441
|
end
|
442
442
|
|
443
443
|
# Create copy of message, as new message object. Returns a fresh zmsg_t
|
444
|
-
# object. If message is null, or memory was exhausted, returns null.
|
444
|
+
# object. If message is null, or memory was exhausted, returns null.
|
445
445
|
#
|
446
446
|
# @return [Zmsg]
|
447
447
|
def dup()
|
@@ -453,7 +453,7 @@ module CZMQ
|
|
453
453
|
end
|
454
454
|
|
455
455
|
# Send message to zsys log sink (may be stdout, or system facility as
|
456
|
-
# configured by zsys_set_logstream).
|
456
|
+
# configured by zsys_set_logstream).
|
457
457
|
#
|
458
458
|
# @return [void]
|
459
459
|
def print()
|
@@ -463,7 +463,7 @@ module CZMQ
|
|
463
463
|
result
|
464
464
|
end
|
465
465
|
|
466
|
-
# Return true if the two messages have the same number of frames and each
|
466
|
+
# Return true if the two messages have the same number of frames and each
|
467
467
|
# frame in the first message is identical to the corresponding frame in the
|
468
468
|
# other message. As with zframe_eq, return false if either message is NULL.
|
469
469
|
#
|
@@ -73,9 +73,9 @@ module CZMQ
|
|
73
73
|
@finalizer = nil
|
74
74
|
end
|
75
75
|
|
76
|
-
# Create new poller, specifying zero or more readers. The list of
|
76
|
+
# Create new poller, specifying zero or more readers. The list of
|
77
77
|
# readers ends in a NULL. Each reader can be a zsock_t instance, a
|
78
|
-
# zactor_t instance, a libzmq socket (void *), or a file handle.
|
78
|
+
# zactor_t instance, a libzmq socket (void *), or a file handle.
|
79
79
|
# @param reader [::FFI::Pointer, #to_ptr]
|
80
80
|
# @param args [Array<Object>]
|
81
81
|
# @return [CZMQ::Zpoller]
|
@@ -95,7 +95,7 @@ module CZMQ
|
|
95
95
|
end
|
96
96
|
|
97
97
|
# Add a reader to be polled. Returns 0 if OK, -1 on failure. The reader may
|
98
|
-
# be a libzmq void * socket, a zsock_t instance, or a zactor_t instance.
|
98
|
+
# be a libzmq void * socket, a zsock_t instance, or a zactor_t instance.
|
99
99
|
#
|
100
100
|
# @param reader [::FFI::Pointer, #to_ptr]
|
101
101
|
# @return [Integer]
|
@@ -107,7 +107,7 @@ module CZMQ
|
|
107
107
|
end
|
108
108
|
|
109
109
|
# Remove a reader from the poller; returns 0 if OK, -1 on failure. The reader
|
110
|
-
# must have been passed during construction, or in an zpoller_add () call.
|
110
|
+
# must have been passed during construction, or in an zpoller_add () call.
|
111
111
|
#
|
112
112
|
# @param reader [::FFI::Pointer, #to_ptr]
|
113
113
|
# @return [Integer]
|
@@ -118,10 +118,10 @@ module CZMQ
|
|
118
118
|
result
|
119
119
|
end
|
120
120
|
|
121
|
-
# By default the poller stops if the process receives a SIGINT or SIGTERM
|
121
|
+
# By default the poller stops if the process receives a SIGINT or SIGTERM
|
122
122
|
# signal. This makes it impossible to shut-down message based architectures
|
123
123
|
# like zactors. This method lets you switch off break handling. The default
|
124
|
-
# nonstop setting is off (false).
|
124
|
+
# nonstop setting is off (false).
|
125
125
|
#
|
126
126
|
# @param nonstop [Boolean]
|
127
127
|
# @return [void]
|
@@ -133,15 +133,15 @@ module CZMQ
|
|
133
133
|
result
|
134
134
|
end
|
135
135
|
|
136
|
-
# Poll the registered readers for I/O, return first reader that has input.
|
137
|
-
# The reader will be a libzmq void * socket, or a zsock_t or zactor_t
|
138
|
-
# instance as specified in zpoller_new/zpoller_add. The timeout should be
|
139
|
-
# zero or greater, or -1 to wait indefinitely. Socket priority is defined
|
140
|
-
# by their order in the poll list. If you need a balanced poll, use the low
|
136
|
+
# Poll the registered readers for I/O, return first reader that has input.
|
137
|
+
# The reader will be a libzmq void * socket, or a zsock_t or zactor_t
|
138
|
+
# instance as specified in zpoller_new/zpoller_add. The timeout should be
|
139
|
+
# zero or greater, or -1 to wait indefinitely. Socket priority is defined
|
140
|
+
# by their order in the poll list. If you need a balanced poll, use the low
|
141
141
|
# level zmq_poll method directly. If the poll call was interrupted (SIGINT),
|
142
|
-
# or the ZMQ context was destroyed, or the timeout expired, returns NULL.
|
143
|
-
# You can test the actual exit condition by calling zpoller_expired () and
|
144
|
-
# zpoller_terminated (). The timeout is in msec.
|
142
|
+
# or the ZMQ context was destroyed, or the timeout expired, returns NULL.
|
143
|
+
# You can test the actual exit condition by calling zpoller_expired () and
|
144
|
+
# zpoller_terminated (). The timeout is in msec.
|
145
145
|
#
|
146
146
|
# @param timeout [Integer, #to_int, #to_i]
|
147
147
|
# @return [::FFI::Pointer]
|
@@ -154,7 +154,7 @@ module CZMQ
|
|
154
154
|
end
|
155
155
|
|
156
156
|
# Return true if the last zpoller_wait () call ended because the timeout
|
157
|
-
# expired, without any error.
|
157
|
+
# expired, without any error.
|
158
158
|
#
|
159
159
|
# @return [Boolean]
|
160
160
|
def expired()
|
@@ -165,7 +165,7 @@ module CZMQ
|
|
165
165
|
end
|
166
166
|
|
167
167
|
# Return true if the last zpoller_wait () call ended because the process
|
168
|
-
# was interrupted, or the parent context was destroyed.
|
168
|
+
# was interrupted, or the parent context was destroyed.
|
169
169
|
#
|
170
170
|
# @return [Boolean]
|
171
171
|
def terminated()
|