pub async fn create(
        id: CellId,
        conductor_handle: ConductorHandle,
        env: EnvironmentWrite,
        mut holochain_p2p_cell: holochain_p2p::HolochainP2pCell,
        managed_task_add_sender: sync::mpsc::Sender<ManagedTaskAdd>,
        managed_task_stop_broadcaster: sync::broadcast::Sender<()>,
    ) -> CellResult<(Self, InitialQueueTriggers)> {
        let conductor_api = CellConductorApi::new(conductor_handle.clone(), id.clone());

        // check if genesis has been run
        let has_genesis = {
            // check if genesis ran on source chain buf
            SourceChainBuf::new(env.clone().into())?.has_genesis()
        };

        if has_genesis {
            holochain_p2p_cell.join().await?;
            let (queue_triggers, initial_queue_triggers) = spawn_queue_consumer_tasks(
                &env,
                holochain_p2p_cell.clone(),
                conductor_api.clone(),
                managed_task_add_sender,
                managed_task_stop_broadcaster,
            )
            .await;

            Ok((
                Self {
                    id,
                    conductor_api,
                    env,
                    holochain_p2p_cell,
                    queue_triggers,
                },
                initial_queue_triggers,
            ))
        } else {
            Err(CellError::CellWithoutGenesis(id))
        }
    }
/// Constructor for a Cell. The SourceChain will be created, and genesis
/// will be run if necessary. A Cell will not be created if the SourceChain
/// is not ready to be used.
Constructor for a Cell. The SourceChain will be created, and genesis
will be run if necessary. A Cell will not be created if the SourceChain
is not ready to be used.
Constructor for a Cell . The SourceChain will be created and genesis will be run if necessary . A Cell will not be created if the SourceChain is not ready to be used .
pub async fn create(
        id: CellId,
        conductor_handle: ConductorHandle,
        env: EnvironmentWrite,
        mut holochain_p2p_cell: holochain_p2p::HolochainP2pCell,
        managed_task_add_sender: sync::mpsc::Sender<ManagedTaskAdd>,
        managed_task_stop_broadcaster: sync::broadcast::Sender<()>,
    ) -> CellResult<(Self, InitialQueueTriggers)> {
        let conductor_api = CellConductorApi::new(conductor_handle.clone(), id.clone());
        // check if genesis has been run
        let has_genesis = {
            // check if genesis ran on source chain buf
            SourceChainBuf::new(env.clone().into())?.has_genesis()
        };
        if has_genesis {
            holochain_p2p_cell.join().await?;
            let (queue_triggers, initial_queue_triggers) = spawn_queue_consumer_tasks(
                &env,
                holochain_p2p_cell.clone(),
                conductor_api.clone(),
                managed_task_add_sender,
                managed_task_stop_broadcaster,
            )
            .await;
            Ok((
                Self {
                    id,
                    conductor_api,
                    env,
                    holochain_p2p_cell,
                    queue_triggers,
                },
                initial_queue_triggers,
            ))
        } else {
            Err(CellError::CellWithoutGenesis(id))
        }
    }
pub async fn create ( id : CellId , conductor_handle : ConductorHandle , env : EnvironmentWrite , mut holochain_p2p_cell : holochain_p2p :: HolochainP2pCell , managed_task_add_sender : sync :: mpsc :: Sender < ManagedTaskAdd > , managed_task_stop_broadcaster : sync :: broadcast :: Sender < ( ) > , ) -> CellResult < ( Self , InitialQueueTriggers ) > { let conductor_api = CellConductorApi :: new ( conductor_handle . clone ( ) , id . clone ( ) ) ; // check if genesis has been run let has_genesis = { // check if genesis ran on source chain buf SourceChainBuf :: new ( env . clone ( ) . into ( ) ) ? . has_genesis ( ) } ; if has_genesis { holochain_p2p_cell . join ( ) . await ? ; let ( queue_triggers , initial_queue_triggers ) = spawn_queue_consumer_tasks ( & env , holochain_p2p_cell . clone ( ) , conductor_api . clone ( ) , managed_task_add_sender , managed_task_stop_broadcaster , ) . await ; Ok ( ( Self { id , conductor_api , env , holochain_p2p_cell , queue_triggers , } , initial_queue_triggers , ) ) } else { Err ( CellError :: CellWithoutGenesis ( id ) ) } }
Constructor for a Cell.
Constructor for a Cell .
id
CellId
conductor_handle
ConductorHandle
env
EnvironmentWrite
holochain_p2p_cell
holochain_p2p::HolochainP2pCell
managed_task_add_sender
sync::mpsc::Sender<ManagedTaskAdd>
managed_task_stop_broadcaster
sync::broadcast::Sender<()>
id
CellId
conductor_handle
ConductorHandle
env
EnvironmentWrite
holochain_p2p_cell
holochain_p2p::HolochainP2pCell
managed_task_add_sender
sync::mpsc::Sender<ManagedTaskAdd>
managed_task_stop_broadcaster
sync::broadcast::Sender<()>