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: poller's handler not aware of event type. #200

Merged
merged 3 commits into from
Apr 9, 2018
Merged

Problem: poller's handler not aware of event type. #200

merged 3 commits into from
Apr 9, 2018

Conversation

kurdybacha
Copy link
Contributor

It was possible to register a handler for more than one event types but
impossible to distinguish which event is being handled.
Now events are passed to a handler.

Besides that some other changes:

  • new test covering changes in the poller
  • modified existing tests to cover changes in the poller
  • defined handler_t in poller_t scope for more convinient use
    and simpler code
  • helper loopback binder to be re-used in tests

It was possible to register a handler for more than one event types but
impossible to distinguish which event is being handled.
Now events are passed to a handler.

Besides that some other changes:
* new test covering changes in the poller
* modified existing tests to cover changes in the poller
* defined handler_t in poller_t scope for more convinient use
  and simpler code
* helper loopback binder to be re-used in tests
@coveralls
Copy link

Pull Request Test Coverage Report for Build 14

  • 0 of 0 (NaN%) changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 54.839%

Totals Coverage Status
Change from base Build 13: 0.0%
Covered Lines: 17
Relevant Lines: 31

💛 - Coveralls

@coveralls
Copy link

coveralls commented Apr 8, 2018

Pull Request Test Coverage Report for Build 16

  • 0 of 0 (NaN%) changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 54.839%

Totals Coverage Status
Change from base Build 13: 0.0%
Covered Lines: 17
Relevant Lines: 31

💛 - Coveralls

Issue #199

It seems that with GCC on Linux <array> is implicitly included
by one of stl includes already in zmq.hpp but it breaks on Windows
with Visual Studio.

Adding explicit include for array.

Can not verify right now but this change is a good practice
so creating a pull request.
@bluca bluca merged commit 1975818 into zeromq:master Apr 9, 2018
void add (zmq::socket_t &socket, short events, std::function<void(void)> &handler)
using handler_t = std::function<void(short)>;

void add (zmq::socket_t &socket, short events, handler_t &handler)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be done in a backwards-compatible way, i.e. keep a function with the old signature that wraps a std:: function<void(void)> and passes it to the function with the new signature.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for review. this is draft so no need for that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. Since it is related to a libzmq draft api, it can be regarded draft in cppzmq as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants