Skip to content

Commit 94e0fb0

Browse files
committed
Problem: deprecated poller's method in draft API
We have a deprecated method `add` in poller that contradicts purpose of a draft API where it can change without deprecation period. Solution: remove the method so we do not to maintain it anymore.
1 parent 17e1d97 commit 94e0fb0

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

tests/poller.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,11 +265,11 @@ TEST(poller, poller_remove_invalid_socket_throws)
265265
TEST(poller, wait_on_added_empty_handler)
266266
{
267267
server_client_setup s;
268-
ASSERT_NO_THROW(s.client.send("Hi"));
268+
ASSERT_NO_THROW (s.client.send ("Hi"));
269269
zmq::poller_t poller;
270-
std::function<void(void)> handler;
271-
ASSERT_NO_THROW(poller.add(s.server, ZMQ_POLLIN, handler));
272-
ASSERT_NO_THROW(poller.wait(std::chrono::milliseconds{-1}));
270+
zmq::poller_t::handler_t handler;
271+
ASSERT_NO_THROW (poller.add (s.server, ZMQ_POLLIN, handler));
272+
ASSERT_NO_THROW (poller.wait (std::chrono::milliseconds {-1}));
273273
}
274274

275275
TEST(poller, modify_empty_throws)

zmq.hpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,13 +1050,6 @@ namespace zmq
10501050

10511051
using handler_t = std::function<void(short)>;
10521052

1053-
ZMQ_DEPRECATED("from 4.3.0, use overload accepting handler_t instead")
1054-
void add (zmq::socket_t &socket, short events, std::function<void(void)> &handler)
1055-
{
1056-
add (socket, events, handler ? [&handler](short) { handler(); }
1057-
: handler_t{});
1058-
}
1059-
10601053
void add (zmq::socket_t &socket, short events, handler_t handler)
10611054
{
10621055
auto it = std::end (handlers);

0 commit comments

Comments
 (0)