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

Threaded log sender #106

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Threaded log sender #106

wants to merge 1 commit into from

Conversation

sjamgade
Copy link
Contributor

This prepares for an AsyncLogSender.

The patch basically breaks down the run method and get_and_send_messages into subparts.
where anythig that is could-be awaited or is worth awaiting is left for subclasses (ThreadedLogSender/AsyncLogSender)

The get_and_send_messages method was doing a lot of work, chunking the messages into batches and waiting for them to be sent. With this patch chunking gets moved to baseclass into get_message_bodies_and_cursor. (no change in behavior over here). In earlier version batches didnt get generated unless required, right now batches get generated. However the batches are pointers into the same buffer, so memory consumption remains same.

maintenance_operations currently is called directly by handle_maintenance_operations, so if if something needs to await it then handle_maintenance_operations will also need to be re-implementeed which would be just be a copy of existing implementation and therefor left in the base class.

get_and_send_messages
There is already a bare except in all the implementations but just to be safe there is extra bare except which makes sure that loop does break apart.

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.

1 participant