Skip to content

flatpak: merge transactions into a single transaction with multiple operations

Harald Sitter requested to merge work/sitter/flatpakthreads into master

this change is comprised of two parts:

FlatpakTransactionsMerger

This is a new object that seeks to merge multiple discover transactions into a single flatpak transaction (with multiple operations as part of it). The way this works is that instead of starting FlatpakJobTransactions right away we schedule them in the merger. The merger will then dispatch all transactions that have been made in a single eventloop run into one backing transaction.

Threading

The threading code has been largely redone to deal with it being comprised of multiple operations on the backing side. The most interesting bit of code here is inside setCurrentRef and handles the transition from one ref to another. FlatpakTransactionThread holds a reference to all associated FlatpakJobTransaction and on-demand connnects/disconnects signals as necessary when the flatpak-side refs change. i.e. to the UI code it seems as though each FlatpakJobTransaction stands on its own because we direct signal emission accordingly. Talking about signals: to simplify locking concerns all interaction between the Thread and its current Transaction is done through signals. This goes so far that the current Transaction is only held as a void* such that one doesn't accidentally call it directly.

Merge request reports

Loading