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

Capability to attach multiple "on_*" handlers #4

Open
walro opened this issue Nov 18, 2015 · 2 comments
Open

Capability to attach multiple "on_*" handlers #4

walro opened this issue Nov 18, 2015 · 2 comments
Labels

Comments

@walro
Copy link
Contributor

walro commented Nov 18, 2015

I think that the current behavior is that the last setup on_* would "win".

For one it would make testing so much easier. See 56927d9#commitcomment-14448933 for some context.

walro referenced this issue Nov 18, 2015
…and use it in tests.

The tests don’t have to run the client in separate threads anymore,
which means that they are faster as you don’t have to sleep for a
second anymore (was used to make sure the client in the thread was
started).

The default timeout is from the tests in mysql-binlog-connector-java.

Don’t know how we can get rid of the duplicated code in TestHelper so
I’ll leave that as it is for now.
@twingly-mob
Copy link
Member

Another way (as we just discussed IRL) could be exposing @client.register_event_listener to the user, then the user could register an arbitrary number of handlers.

That is what mysql-binlog-connector does in its test: https://github.com/shyiko/mysql-binlog-connector-java/blob/0.2.4/src/test/java/com/github/shyiko/mysql/binlog/BinaryLogClientTest.java#L32-L44

We would need to expose SaveEventListener and RowEventListener so the user could use them as handlers, if the user thinks they are suitable.

@dentarg
Copy link
Contributor

dentarg commented Dec 2, 2015

There was some back and forth about multiple listeners in shyiko/mysql-binlog-connector-java#15

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

No branches or pull requests

3 participants