Skip to content

Commit e57d93b

Browse files
authored
Merge pull request #1543 from bluca/zloop_interr
Problem: interrupt handling was retired, but replacement is draft
2 parents 6a3afba + 5eea92f commit e57d93b

File tree

8 files changed

+299
-263
lines changed

8 files changed

+299
-263
lines changed

README.md

Lines changed: 281 additions & 205 deletions
Large diffs are not rendered by default.

api/zloop.api

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@
158158
<argument name = "verbose" type = "boolean" />
159159
</method>
160160

161-
<method name = "set nonstop" state = "draft" >
161+
<method name = "set nonstop" >
162162
By default the reactor stops if the process receives a SIGINT or SIGTERM
163163
signal. This makes it impossible to shut-down message based architectures
164164
like zactors. This method lets you switch off break handling. The default

api/zpoller.api

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<return type = "integer" />
3636
</method>
3737

38-
<method name = "set nonstop" state = "draft" >
38+
<method name = "set nonstop" >
3939
By default the poller stops if the process receives a SIGINT or SIGTERM
4040
signal. This makes it impossible to shut-down message based architectures
4141
like zactors. This method lets you switch off break handling. The default

bindings/ruby/lib/czmq/ffi.rb

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -480,14 +480,7 @@ def self.available?
480480
attach_function :zloop_set_ticket_delay, [:pointer, :size_t], :void, **opts
481481
attach_function :zloop_set_max_timers, [:pointer, :size_t], :void, **opts
482482
attach_function :zloop_set_verbose, [:pointer, :bool], :void, **opts
483-
begin # DRAFT method
484-
attach_function :zloop_set_nonstop, [:pointer, :bool], :void, **opts
485-
rescue ::FFI::NotFoundError
486-
if $VERBOSE || $DEBUG
487-
warn "The function zloop_set_nonstop() can't be used through " +
488-
"this Ruby binding because it's not available."
489-
end
490-
end
483+
attach_function :zloop_set_nonstop, [:pointer, :bool], :void, **opts
491484
attach_function :zloop_start, [:pointer], :int, **opts
492485
attach_function :zloop_test, [:bool], :void, **opts
493486

@@ -550,14 +543,7 @@ def self.available?
550543
attach_function :zpoller_destroy, [:pointer], :void, **opts
551544
attach_function :zpoller_add, [:pointer, :pointer], :int, **opts
552545
attach_function :zpoller_remove, [:pointer, :pointer], :int, **opts
553-
begin # DRAFT method
554-
attach_function :zpoller_set_nonstop, [:pointer, :bool], :void, **opts
555-
rescue ::FFI::NotFoundError
556-
if $VERBOSE || $DEBUG
557-
warn "The function zpoller_set_nonstop() can't be used through " +
558-
"this Ruby binding because it's not available."
559-
end
560-
end
546+
attach_function :zpoller_set_nonstop, [:pointer, :bool], :void, **opts
561547
attach_function :zpoller_wait, [:pointer, :int], :pointer, **opts
562548
attach_function :zpoller_expired, [:pointer], :bool, **opts
563549
attach_function :zpoller_terminated, [:pointer], :bool, **opts

images/README_1.png

8.01 KB
Loading

include/zloop.h

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ extern "C" {
2323
// @interface
2424
// This is a stable class, and may not change except for emergencies. It
2525
// is provided in stable builds.
26-
// This class has draft methods, which may change over time. They are not
27-
// in stable releases, by default. Use --enable-drafts to enable.
2826
// Callback function for reactor socket activity
2927
typedef int (zloop_reader_fn) (
3028
zloop_t *loop, zsock_t *reader, void *arg);
@@ -134,6 +132,13 @@ CZMQ_EXPORT void
134132
CZMQ_EXPORT void
135133
zloop_set_verbose (zloop_t *self, bool verbose);
136134

135+
// By default the reactor stops if the process receives a SIGINT or SIGTERM
136+
// signal. This makes it impossible to shut-down message based architectures
137+
// like zactors. This method lets you switch off break handling. The default
138+
// nonstop setting is off (false).
139+
CZMQ_EXPORT void
140+
zloop_set_nonstop (zloop_t *self, bool nonstop);
141+
137142
// Start the reactor. Takes control of the thread and returns when the 0MQ
138143
// context is terminated or the process is interrupted, or any event handler
139144
// returns -1. Event handlers may register new sockets and timers, and
@@ -145,16 +150,6 @@ CZMQ_EXPORT int
145150
CZMQ_EXPORT void
146151
zloop_test (bool verbose);
147152

148-
#ifdef CZMQ_BUILD_DRAFT_API
149-
// *** Draft method, for development use, may change without warning ***
150-
// By default the reactor stops if the process receives a SIGINT or SIGTERM
151-
// signal. This makes it impossible to shut-down message based architectures
152-
// like zactors. This method lets you switch off break handling. The default
153-
// nonstop setting is off (false).
154-
CZMQ_EXPORT void
155-
zloop_set_nonstop (zloop_t *self, bool nonstop);
156-
157-
#endif // CZMQ_BUILD_DRAFT_API
158153
// @end
159154

160155

include/zpoller.h

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ extern "C" {
2323
// @interface
2424
// This is a stable class, and may not change except for emergencies. It
2525
// is provided in stable builds.
26-
// This class has draft methods, which may change over time. They are not
27-
// in stable releases, by default. Use --enable-drafts to enable.
2826
// Create new poller, specifying zero or more readers. The list of
2927
// readers ends in a NULL. Each reader can be a zsock_t instance, a
3028
// zactor_t instance, a libzmq socket (void *), or a file handle.
@@ -45,6 +43,13 @@ CZMQ_EXPORT int
4543
CZMQ_EXPORT int
4644
zpoller_remove (zpoller_t *self, void *reader);
4745

46+
// By default the poller stops if the process receives a SIGINT or SIGTERM
47+
// signal. This makes it impossible to shut-down message based architectures
48+
// like zactors. This method lets you switch off break handling. The default
49+
// nonstop setting is off (false).
50+
CZMQ_EXPORT void
51+
zpoller_set_nonstop (zpoller_t *self, bool nonstop);
52+
4853
// Poll the registered readers for I/O, return first reader that has input.
4954
// The reader will be a libzmq void * socket, or a zsock_t or zactor_t
5055
// instance as specified in zpoller_new/zpoller_add. The timeout should be
@@ -71,16 +76,6 @@ CZMQ_EXPORT bool
7176
CZMQ_EXPORT void
7277
zpoller_test (bool verbose);
7378

74-
#ifdef CZMQ_BUILD_DRAFT_API
75-
// *** Draft method, for development use, may change without warning ***
76-
// By default the poller stops if the process receives a SIGINT or SIGTERM
77-
// signal. This makes it impossible to shut-down message based architectures
78-
// like zactors. This method lets you switch off break handling. The default
79-
// nonstop setting is off (false).
80-
CZMQ_EXPORT void
81-
zpoller_set_nonstop (zpoller_t *self, bool nonstop);
82-
83-
#endif // CZMQ_BUILD_DRAFT_API
8479
// @end
8580

8681

src/czmq_classes.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,6 @@ CZMQ_EXPORT zframe_t *
9292
CZMQ_EXPORT zhashx_t *
9393
zhashx_unpack_own (zframe_t *frame, zhashx_deserializer_fn deserializer);
9494

95-
// *** Draft method, defined for internal use only ***
96-
// By default the reactor stops if the process receives a SIGINT or SIGTERM
97-
// signal. This makes it impossible to shut-down message based architectures
98-
// like zactors. This method lets you switch off break handling. The default
99-
// nonstop setting is off (false).
100-
CZMQ_EXPORT void
101-
zloop_set_nonstop (zloop_t *self, bool nonstop);
102-
10395
// *** Draft method, defined for internal use only ***
10496
// Return message routing ID, if the message came from a ZMQ_SERVER socket.
10597
// Else returns zero.
@@ -112,14 +104,6 @@ CZMQ_EXPORT uint32_t
112104
CZMQ_EXPORT void
113105
zmsg_set_routing_id (zmsg_t *self, uint32_t routing_id);
114106

115-
// *** Draft method, defined for internal use only ***
116-
// By default the poller stops if the process receives a SIGINT or SIGTERM
117-
// signal. This makes it impossible to shut-down message based architectures
118-
// like zactors. This method lets you switch off break handling. The default
119-
// nonstop setting is off (false).
120-
CZMQ_EXPORT void
121-
zpoller_set_nonstop (zpoller_t *self, bool nonstop);
122-
123107
// *** Draft method, defined for internal use only ***
124108
// Create a SERVER socket. Default action is bind.
125109
// Caller owns return value and must destroy it when done.

0 commit comments

Comments
 (0)