Skip to main content

ElasticPool

Struct ElasticPool 

Source
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: u8

Floor — keep at least this many members running.

§max: u8

Ceiling — never run more than this many members.

§policy: P

The scaling policy driving grow/shrink decisions.

Trait Implementations§

Source§

impl<P: ScalingPolicy + Sync> Pool for ElasticPool<P>

Source§

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>

Earliest instant this pool must be re-evaluated without a signal.
Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.