Skip to content

Threaded log sender#106

Open
sjamgade wants to merge 1 commit intomasterfrom
sum12-only-async
Open

Threaded log sender#106
sjamgade wants to merge 1 commit intomasterfrom
sum12-only-async

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