pub struct Manager {
pub config: Config,
/* private fields */
}
Expand description
The worker manager. Right now, assumes that all workers are on the same host
Fields§
§config: Config
System configuration
Implementations§
source§impl Manager
impl Manager
sourcepub async fn new(model_file: &str, config: Config) -> Result<Self>
pub async fn new(model_file: &str, config: Config) -> Result<Self>
Start a new manager and start NUM_INIT_WORKERS
new worker processes
sourcepub fn set_worker_status(&mut self, pid: u32, status: WorkerStatus)
pub fn set_worker_status(&mut self, pid: u32, status: WorkerStatus)
Set the status of a worker
sourcepub async fn run_inference(
channel: Channel,
input: InferenceTask
) -> Result<TimedInference>
pub async fn run_inference( channel: Channel, input: InferenceTask ) -> Result<TimedInference>
Run inference on a worker given an RPC channel to the worker
sourcepub fn get_idle_worker(&self) -> Option<Handle>
pub fn get_idle_worker(&self) -> Option<Handle>
Get a handle to an idle worker, if any workers are idle
sourcepub fn all_status(&self) -> Result<HashMap<Handle, WorkerStatus>>
pub fn all_status(&self) -> Result<HashMap<Handle, WorkerStatus>>
Get the statuses of all workers
pub fn all_workers(&self) -> Result<HashMap<Handle, WorkerStatus>>
sourcepub fn workers(&self) -> Vec<PartialHandle>
pub fn workers(&self) -> Vec<PartialHandle>
Return all the workers, without their status
sourcepub async fn all_stats(&self) -> Result<HashMap<PartialHandle, u64>>
pub async fn all_stats(&self) -> Result<HashMap<PartialHandle, u64>>
Get statistics of all workers
sourcepub async fn start_new_workers(&mut self, n: u16) -> Result<()>
pub async fn start_new_workers(&mut self, n: u16) -> Result<()>
Start a new worker process on the local machine and connect to it
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Manager
impl Send for Manager
impl Sync for Manager
impl Unpin for Manager
impl !UnwindSafe for Manager
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request