History | View | Annotate | Download (5 kB)
quotaholder: Improve data of NoCapacityError
Replace `available' by two fields: `limit' and `usage'.
quotaholder: Unify accept and reject commission code
Incorporate accept/reject functions in resolve_pending_commissions,in order to enforce a total ordering on locking holdings.Add a wrapper (resolve_pending_commission) that operates on a singleserial.
Prepare quotaholder calls for the new API
- {accept, reject}_commission take a single serial- resolve_pending_commissions takes a set of serials to accept and a set of serials to reject- commission exceptions record the provision on which they are raised...
Turn holding into a counter
The role of Holding is now only to keep track of usage againsta limit. There is no more exporting of resources and thus no needfor the stock counters.
Rename capacity to limit
Redesign quota holding
A Holding now tracks the current usage (amount imported)and the amount available to export (stock).
Counters come in pairs (imported_min, imported_max andstock_min, stock_max respectively) to allow for a two-stepcommission.
For example, issuing a commission to import some quantity...
Merge Policy model into Holding
Since the removal of quantity, Policy was left with only one value:capacity. To simplify things, we directly include capacity in Holding.
This makes obsolete the following functions, which are removed:get_limits, set_limits, get_holding, set_holding.