Skip to content

Conversation

Photonios
Copy link

Without this, it's impossible to stop the main loop from another thread and the process is stuck forever.

@baloo
Copy link
Collaborator

baloo commented Apr 16, 2018

This implementation is incorrect. The loops currently exits when a packet is fully parsed, and the stream can continue.
Your implementation makes the stream "dirty". It stops in the middle of the parsing of a packet and another call to fetch_one would return an error. The current implementation does not.

Also, fetch_one is not a main loop. It fetches one packet, and parses it. The main loop should be in your code.

Copy link
Collaborator

@baloo baloo left a comment

Choose a reason for hiding this comment

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

"main loop" would be here if you use BinLogStreamReader as an iterator

@baloo
Copy link
Collaborator

baloo commented Apr 16, 2018

"main loop" would be in the __iter__ if you use BinLogStreamReader as an iterator (github does not show comment in context if you do not change this line)

@baloo baloo closed this Sep 5, 2018
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.

2 participants