-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
General refactoring of txqueue and manager
Changes to TxQueue: - factored out into a separate module to ensure that only exported methods will be used - deleted EnqueuAsync as it is not used, it is always possible to restore it from git, if it will be ever needed - notifications moved to a manager, with the goal to simplify txqueue and separate concerns between manager and txqueue - simplified API for processing transactions After analyzing code I removed all redundant methods and currently all the processing can be done with Get and Done methods. - added inprogress map to store transactions that are taken for processing and removed Inprogress variable from transaction, the goal is to cleanup tx structure - removed Discard channel from transaction, transaction.Err can be used to understand if transaction was discarded or failed due to another error - transient errors stored as global variable of queue module for simplicity, it is unlikely that they will become dynamic Change to Manager: - simplified code that manages notifications, all handlers were removed and notifiers refactored to be simple functions that are called in two places, when transaction is queued and when manager finished waiting for transaction - notifications can be turned of by calling DisableNotifications on manager - made a function out of CreateTransaction method, as it can be used as a simple utility
- Loading branch information
Showing
17 changed files
with
431 additions
and
533 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.