Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This prepares for an
AsyncLogSender
.The patch basically breaks down the
run
method andget_and_send_messages
into subparts.where anythig that is could-be
await
ed or is worthawait
ing 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 intoget_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 byhandle_maintenance_operations
, so if if something needs toawait
it thenhandle_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 bareexcept
which makes sure that loop does break apart.