[−][src]Struct mediasoup::worker::Worker
A worker represents a mediasoup C++ subprocess that runs on a single CPU core and handles
Router
instances.
Implementations
impl Worker
[src]
pub fn pid(&self) -> u32
[src]
The PID of the worker process.
pub fn app_data(&self) -> &AppData
[src]
Custom application data.
pub fn closed(&self) -> bool
[src]
Whether the worker is closed.
pub async fn get_resource_usage(
&self
) -> Result<WorkerResourceUsage, RequestError>
[src]
&self
) -> Result<WorkerResourceUsage, RequestError>
Provides resource usage of the mediasoup-worker subprocess.
pub async fn update_settings(
&self,
data: WorkerUpdateSettings
) -> Result<(), RequestError>
[src]
&self,
data: WorkerUpdateSettings
) -> Result<(), RequestError>
Updates the worker settings in runtime. Just a subset of the worker settings can be updated.
pub async fn create_router(
&self,
router_options: RouterOptions
) -> Result<Router, CreateRouterError>
[src]
&self,
router_options: RouterOptions
) -> Result<Router, CreateRouterError>
Create a Router.
Worker will be kept alive as long as at least one router instance is alive.
pub fn on_new_router<F: Fn(&Router) + Send + Sync + 'static>(
&self,
callback: F
) -> HandlerId
[src]
&self,
callback: F
) -> HandlerId
Callback is called when a new router is created.
pub fn on_dead<F: FnOnce(ExitStatus) + Send + Sync + 'static>(
&self,
callback: F
) -> HandlerId
[src]
&self,
callback: F
) -> HandlerId
Callback is called when the worker process unexpectedly dies.
pub fn on_close<F: FnOnce() + Send + 'static>(&self, callback: F) -> HandlerId
[src]
Callback is called when the worker is closed for whatever reason.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Worker
[src]
impl Send for Worker
[src]
impl Sync for Worker
[src]
impl Unpin for Worker
[src]
impl !UnwindSafe for Worker
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,