create_pool_data_from_arc

Function create_pool_data_from_arc 

Source
pub fn create_pool_data_from_arc(
    pool: Arc<Mutex<BrowserPool>>,
) -> BrowserPoolData
Expand description

Create Actix-web Data from an Arc reference.

Use this when you need to keep a reference to the pool for shutdown.

§Parameters

  • pool - Arc reference to the shared browser pool.

§Returns

BrowserPoolData ready for use with App::app_data().

§Example

use html2pdf_api::integrations::actix::create_pool_data_from_arc;

let shared_pool = pool.into_shared();
let pool_for_shutdown = Arc::clone(&shared_pool);
let pool_data = create_pool_data_from_arc(shared_pool);

// Use pool_data in App
// Use pool_for_shutdown for cleanup