pub async fn create(
        id: CellId,
        conductor_handle: ConductorHandle,
        env: EnvWrite,
        cache: EnvWrite,
        aingle_p2p_cell: aingle_p2p::AIngleP2pCell,
        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.
            GenesisWorkspace::new(env.clone())?.has_genesis(id.agent_pubkey())?
        };

        if has_genesis {
            let (queue_triggers, initial_queue_triggers) = spawn_queue_consumer_tasks(
                env.clone(),
                cache.clone(),
                aingle_p2p_cell.clone(),
                conductor_handle.clone(),
                conductor_api.clone(),
                managed_task_add_sender,
                managed_task_stop_broadcaster,
            )
            .await;

            Ok((
                Self {
                    id,
                    conductor_api,
                    env,
                    cache,
                    aingle_p2p_cell,
                    queue_triggers,
                },
                initial_queue_triggers,
            ))
        } else {
            Err(CellError::CellWithoutGenesis(id))
        }
    }
/// Constructor for a Cell, which ensure the Cell is fully initialized
/// before returning.
///
/// If it hasn't happened already, a SourceChain will be created, and
/// genesis will be run. If these have already happened, those steps are
/// skipped.
///
/// No Cell will be created if the SourceChain is not ready to be used.
Constructor for a Cell, which ensure the Cell is fully initialized
before returning.

If it hasn't happened already, a SourceChain will be created, and
genesis will be run. If these have already happened, those steps are
skipped.

No Cell will be created if the SourceChain is not ready to be used.
Constructor for a Cell which ensure the Cell is fully initialized before returning . If it hasn ' t happened already a SourceChain will be created and genesis will be run . If these have already happened those steps are skipped . No Cell will be created if the SourceChain is not ready to be used .
pub async fn create(
        id: CellId,
        conductor_handle: ConductorHandle,
        env: EnvWrite,
        cache: EnvWrite,
        aingle_p2p_cell: aingle_p2p::AIngleP2pCell,
        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.
            GenesisWorkspace::new(env.clone())?.has_genesis(id.agent_pubkey())?
        };
        if has_genesis {
            let (queue_triggers, initial_queue_triggers) = spawn_queue_consumer_tasks(
                env.clone(),
                cache.clone(),
                aingle_p2p_cell.clone(),
                conductor_handle.clone(),
                conductor_api.clone(),
                managed_task_add_sender,
                managed_task_stop_broadcaster,
            )
            .await;
            Ok((
                Self {
                    id,
                    conductor_api,
                    env,
                    cache,
                    aingle_p2p_cell,
                    queue_triggers,
                },
                initial_queue_triggers,
            ))
        } else {
            Err(CellError::CellWithoutGenesis(id))
        }
    }
pub async fn create ( id : CellId , conductor_handle : ConductorHandle , env : EnvWrite , cache : EnvWrite , aingle_p2p_cell : aingle_p2p :: AIngleP2pCell , 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. GenesisWorkspace :: new ( env . clone ( ) ) ? . has_genesis ( id . agent_pubkey ( ) ) ? } ; if has_genesis { let ( queue_triggers , initial_queue_triggers ) = spawn_queue_consumer_tasks ( env . clone ( ) , cache . clone ( ) , aingle_p2p_cell . clone ( ) , conductor_handle . clone ( ) , conductor_api . clone ( ) , managed_task_add_sender , managed_task_stop_broadcaster , ) . await ; Ok ( ( Self { id , conductor_api , env , cache , aingle_p2p_cell , queue_triggers , } , initial_queue_triggers , ) ) } else { Err ( CellError :: CellWithoutGenesis ( id ) ) } }
Constructor for a Cell, which ensure the Cell is fully initialized
before returning.
Constructor for a Cell which ensure the Cell is fully initialized before returning .
id
CellId
conductor_handle
ConductorHandle
env
EnvWrite
cache
EnvWrite
aingle_p2p_cell
aingle_p2p::AIngleP2pCell
managed_task_add_sender
sync::mpsc::Sender<ManagedTaskAdd>
managed_task_stop_broadcaster
sync::broadcast::Sender<()>
id
CellId
conductor_handle
ConductorHandle
env
EnvWrite
cache
EnvWrite
aingle_p2p_cell
aingle_p2p::AIngleP2pCell
managed_task_add_sender
sync::mpsc::Sender<ManagedTaskAdd>
managed_task_stop_broadcaster
sync::broadcast::Sender<()>