clboss/Boss/Mod/XRebalancer.hpp
Ken Sedgwick bf890358a1
Rename rebalance mode xrebalance2 to xrebalance
The "2" distinguished plugin execution from the internal executor;
with the internal executor gone the suffix is noise.  Mechanical
rename across the mode enum, option description, driver gates and
logs, docs, and the test.  No alias for the old value -- it was
never in a release, and the only configs carrying it (lab0, prod1)
get edited at deploy anyway.
2026-08-18 15:28:11 -07:00

42 lines
1.1 KiB
C++

#ifndef BOSS_MOD_XREBALANCER_HPP
#define BOSS_MOD_XREBALANCER_HPP
#include<memory>
namespace Boss { namespace Mod { class Waiter; }}
namespace S { class Bus; }
namespace Boss { namespace Mod {
/** class Boss::Mod::XRebalancer
*
* @brief The xrebalance rebalancer driver: a periodic, Poisson-paced
* loop that decides WHEN to run a circular-askrene rebalance cycle,
* plans it, and executes it through the external xrebalance plugin.
*
* Cadence is a memoryless Poisson process whose average rate is the
* `clboss-xrebalance-per-hour` option (0 = paused), tunable at runtime.
* The loop self-gates on the rebalance mode and only runs a cycle when
* the active mode is `xrebalance`; in other modes it idles (skips the
* cycle body) so flipping the mode at runtime starts firing without a
* restart.
*/
class XRebalancer {
private:
class Impl;
std::unique_ptr<Impl> pimpl;
public:
XRebalancer() =delete;
XRebalancer(XRebalancer const&) =delete;
XRebalancer(XRebalancer&&);
~XRebalancer();
explicit
XRebalancer(S::Bus& bus, Boss::Mod::Waiter& waiter);
};
}}
#endif /* !defined(BOSS_MOD_XREBALANCER_HPP) */