pub struct ElasticPool<P: ScalingPolicy> {
pub nodes: &'static [&'static TaskNode],
pub min: u8,
pub max: u8,
pub policy: P,
}Expand description
An elastic pool of single-instance nodes scaled by policy P.
Fields§
§nodes: &'static [&'static TaskNode]The pool’s member nodes (each a single-instance OnDemand/Terminate node).
min: u8Floor — keep at least this many members running.
max: u8Ceiling — never run more than this many members.
policy: PThe scaling policy driving grow/shrink decisions.
Trait Implementations§
Source§impl<P: ScalingPolicy + Sync> Pool for ElasticPool<P>
impl<P: ScalingPolicy + Sync> Pool for ElasticPool<P>
Source§fn evaluate(&self, now: Instant) -> PoolAction
fn evaluate(&self, now: Instant) -> PoolAction
Run the policy against the current snapshot and report the action to
apply. Does not itself start/stop (that’s async — the caller does it).
Source§fn deferred_until(&self) -> Option<Instant>
fn deferred_until(&self) -> Option<Instant>
Earliest instant this pool must be re-evaluated without a signal.
Source§fn members(&self) -> &'static [&'static TaskNode]
fn members(&self) -> &'static [&'static TaskNode]
The pool’s member nodes (floor first). Used by the supervisor’s control
interface to co-control a whole pool from any member, and by a task-state
view to group members. This is the single source of pool membership — the
same slice the scaling policy iterates.
Auto Trait Implementations§
impl<P> !RefUnwindSafe for ElasticPool<P>
impl<P> !UnwindSafe for ElasticPool<P>
impl<P> Freeze for ElasticPool<P>where
P: Freeze,
impl<P> Send for ElasticPool<P>where
P: Send,
impl<P> Sync for ElasticPool<P>where
P: Sync,
impl<P> Unpin for ElasticPool<P>where
P: Unpin,
impl<P> UnsafeUnpin for ElasticPool<P>where
P: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more