[−][src]Struct mediasoup::worker_manager::WorkerManager
Container that creates Worker instances
Examples
use futures_lite::future; use mediasoup::worker::WorkerSettings; use mediasoup::worker_manager::WorkerManager; // Create a manager that will use specified binary for spawning new worker processes let worker_manager = WorkerManager::new( "/path/to/mediasoup-worker".into(), ); future::block_on(async move { // Create a new worker with default settings let worker = worker_manager .create_worker(WorkerSettings::default()) .await .unwrap(); })
If you already happen to have async_executor::Executor
instance available,
WorkerManager::with_executor()
can be used to create an instance instead.
Implementations
impl WorkerManager
[src]
pub fn new(worker_binary: PathBuf) -> Self
[src]
Create new worker manager, internally a new thread with executor will be created.
pub fn with_executor(
worker_binary: PathBuf,
executor: Arc<Executor<'static>>
) -> Self
[src]
worker_binary: PathBuf,
executor: Arc<Executor<'static>>
) -> Self
Create new worker manager, uses externally provided executor.
pub async fn create_worker<'_>(
&'_ self,
worker_settings: WorkerSettings
) -> Result<Worker>
[src]
&'_ self,
worker_settings: WorkerSettings
) -> Result<Worker>
Create a Worker.
Worker manager will be kept alive as long as at least one worker instance is alive.
pub fn on_new_worker<F: Fn(&Worker) + Send + 'static>(
&self,
callback: F
) -> HandlerId
[src]
&self,
callback: F
) -> HandlerId
Trait Implementations
impl Clone for WorkerManager
[src]
fn clone(&self) -> WorkerManager
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl !RefUnwindSafe for WorkerManager
impl Send for WorkerManager
impl Sync for WorkerManager
impl Unpin for WorkerManager
impl !UnwindSafe for WorkerManager
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,
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.
fn to_owned(&self) -> T
[src]
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.
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.
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>,