/// Create a new sandboxed execution controller. It provides the
/// same interface as the `WasmExecutor`.
Create a new sandboxed execution controller. It provides the
same interface as the `WasmExecutor`.
Create a new sandboxed execution controller . It provides the same interface as the ` WasmExecutor ` .
pub fn new(logger: ReplicaLogger, metrics_registry: &MetricsRegistry) -> Self {
        let sandbox_exec_argv = create_sandbox_argv().expect("No canister_sandbox binary found");
        let backends = Arc::new(Mutex::new(HashMap::new()));
        let metrics = Arc::new(SandboxedExecutionMetrics::new(metrics_registry));
        let backends_copy = Arc::clone(&backends);
        let metrics_copy = Arc::clone(&metrics);
        let logger_copy = logger.clone();
        std::thread::spawn(move || {
            SandboxedExecutionController::collect_process_metrics(
                logger_copy,
                backends_copy,
                metrics_copy,
            );
        });
        Self {
            backends,
            logger,
            compile_count_for_testing: AtomicU64::new(0),
            sandbox_exec_argv,
            metrics,
        }
    }
pub fn new ( logger : ReplicaLogger , metrics_registry : & MetricsRegistry ) -> Self { let sandbox_exec_argv = create_sandbox_argv ( ) . expect ( " " ) ; let backends = Arc :: new ( Mutex :: new ( HashMap :: new ( ) ) ) ; let metrics = Arc :: new ( SandboxedExecutionMetrics :: new ( metrics_registry ) ) ; let backends_copy = Arc :: clone ( & backends ) ; let metrics_copy = Arc :: clone ( & metrics ) ; let logger_copy = logger . clone ( ) ; std :: thread :: spawn ( move | | { SandboxedExecutionController :: collect_process_metrics ( logger_copy , backends_copy , metrics_copy , ) ; } ) ; Self { backends , logger , compile_count_for_testing : AtomicU64 :: new ( 0 ) , sandbox_exec_argv , metrics , } }
Create a new sandboxed execution controller.
Create a new sandboxed execution controller .
logger
ReplicaLogger
metrics_registry
&MetricsRegistry