Skip to content

Refactor _TransactionQueueManager to delineate transaction preparation and completion.#19670

Open
reivilibre wants to merge 2 commits intodevelopfrom
rei/se_ref_fed_tqm_delineate
Open

Refactor _TransactionQueueManager to delineate transaction preparation and completion.#19670
reivilibre wants to merge 2 commits intodevelopfrom
rei/se_ref_fed_tqm_delineate

Conversation

@reivilibre
Copy link
Copy Markdown
Contributor

A small commit that splits up _TransactionQueueManager to pass through its information in a new struct,
making the data flow easier to see.

The grand plan is that this will make it easier to have an alternative mode of transaction preparation,
for sticky event backlogs.

Signed-off-by: Olivier 'reivilibre <oliverw@matrix.org>
Comment on lines -837 to -838
if not self._pdus and not pending_edus:
return [], []
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is the only part that actually got removed, because it didn't seem worth having an early return to save 1 if statement.

@reivilibre reivilibre marked this pull request as ready for review April 8, 2026 14:58
@reivilibre reivilibre requested a review from a team as a code owner April 8, 2026 14:58
Comment thread changelog.d/19670.misc
@@ -0,0 +1 @@
Refactor `_TransactionQueueManager` to delineate transaction preparation and completion. No newline at end of file
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this is an OK change, though I'm a bit confused why moving the variables into a separate class is simpler? As it is I'm not sure this really simplifies things, beyond the extra comments?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I mean you're not wrong, it's not a wholly important change.

If I had to put words to it, I guess I have a preference for passing immutable structs around rather than having fields in some 'unset' state on self and mutating them. (Another illustration is: Option<struct> vs struct with Option<> on every field.)
If you don't have this preference it may make less sense.

For sticky events I intend to add a new way of preparing transactions and some new code to run on completion; I felt that it would be messy to just add to the pile of unset things

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants