pub struct Forge { /* private fields */ }Expand description
Main Forge runtime
Implementations§
Source§impl Forge
impl Forge
Sourcepub async fn state(&self) -> RuntimeState
pub async fn state(&self) -> RuntimeState
Get current runtime state
Sourcepub fn uptime_secs(&self) -> u64
pub fn uptime_secs(&self) -> u64
Get uptime in seconds
Sourcepub fn metrics(&self) -> Option<&Arc<ForgeMetrics>>
pub fn metrics(&self) -> Option<&Arc<ForgeMetrics>>
Get metrics instance
Sourcepub fn store(&self) -> &BoxedStateStore
pub fn store(&self) -> &BoxedStateStore
Get the state store
Sourcepub fn router(&self) -> &BoxedMoERouter
pub fn router(&self) -> &BoxedMoERouter
Get the MoE router
Sourcepub fn signal_shutdown(&self)
pub fn signal_shutdown(&self)
Signal shutdown
Sourcepub fn shutdown_receiver(&self) -> Receiver<()>
pub fn shutdown_receiver(&self) -> Receiver<()>
Subscribe to shutdown signal
Sourcepub async fn submit_job(&self, job: Job) -> Result<String>
pub async fn submit_job(&self, job: Job) -> Result<String>
Submit a job
Sourcepub async fn scale_job(
&self,
job_id: &str,
group: &str,
count: u32,
) -> Result<()>
pub async fn scale_job( &self, job_id: &str, group: &str, count: u32, ) -> Result<()>
Scale a job’s task group
Sourcepub async fn route(&self, input: &str) -> RouteResult
pub async fn route(&self, input: &str) -> RouteResult
Route an input to an expert
Sourcepub fn register_expert(&self, expert: Expert)
pub fn register_expert(&self, expert: Expert)
Register an expert
Sourcepub fn update_expert_load(&self, index: usize, load: f64)
pub fn update_expert_load(&self, index: usize, load: f64)
Update expert load
Sourcepub async fn evaluate_scaling(
&self,
job_id: &str,
cpu: f64,
memory: f64,
instances: u32,
) -> ScalingDecision
pub async fn evaluate_scaling( &self, job_id: &str, cpu: f64, memory: f64, instances: u32, ) -> ScalingDecision
Evaluate autoscaling for a job
Auto Trait Implementations§
impl !Freeze for Forge
impl !RefUnwindSafe for Forge
impl Send for Forge
impl Sync for Forge
impl Unpin for Forge
impl !UnwindSafe for Forge
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more