Struct holochain::core::queue_consumer::QueueConsumerMap
source · pub struct QueueConsumerMap { /* private fields */ }
Expand description
Map of running queue consumers workflows per dna space.
Implementations§
source§impl QueueConsumerMap
impl QueueConsumerMap
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new queue consumer map.
Examples found in repository?
More examples
src/conductor/space.rs (line 159)
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164
pub fn new(config: &ConductorConfig) -> ConductorResult<Self> {
let root_db_dir = config.environment_path.clone();
let db_sync_strategy = config.db_sync_strategy;
let db_sync_level = match db_sync_strategy {
DbSyncStrategy::Fast => DbSyncLevel::Off,
DbSyncStrategy::Resilient => DbSyncLevel::Normal,
};
let conductor_db =
DbWrite::open_with_sync_level(root_db_dir.as_ref(), DbKindConductor, db_sync_level)?;
let wasm_db =
DbWrite::open_with_sync_level(root_db_dir.as_ref(), DbKindWasm, db_sync_level)?;
Ok(Spaces {
map: RwShare::new(HashMap::new()),
db_dir: Arc::new(root_db_dir),
db_sync_strategy,
queue_consumer_map: QueueConsumerMap::new(),
conductor_db,
wasm_db,
network_config: config.network.clone().unwrap_or_default(),
})
}
sourcepub fn validation_receipt_trigger(
&self,
dna_hash: Arc<DnaHash>
) -> Option<TriggerSender>
pub fn validation_receipt_trigger(
&self,
dna_hash: Arc<DnaHash>
) -> Option<TriggerSender>
Get the validation receipt trigger for this dna hash.
sourcepub fn integration_trigger(
&self,
dna_hash: Arc<DnaHash>
) -> Option<TriggerSender>
pub fn integration_trigger(
&self,
dna_hash: Arc<DnaHash>
) -> Option<TriggerSender>
Get the integration trigger for this dna hash.
Examples found in repository?
src/conductor/cell.rs (line 212)
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217
pub async fn genesis<Ribosome>(
id: CellId,
conductor_handle: ConductorHandle,
authored_db: DbWrite<DbKindAuthored>,
dht_db: DbWrite<DbKindDht>,
dht_db_cache: DhtDbQueryCache,
ribosome: Ribosome,
membrane_proof: Option<MembraneProof>,
chc: Option<ChcImpl>,
) -> CellResult<()>
where
Ribosome: RibosomeT + 'static,
{
// get the dna
let dna_file = conductor_handle
.get_dna_file(id.dna_hash())
.ok_or_else(|| DnaError::DnaMissing(id.dna_hash().to_owned()))?;
let conductor_api = CellConductorApi::new(conductor_handle.clone(), id.clone());
// run genesis
let workspace = GenesisWorkspace::new(authored_db, dht_db)
.map_err(ConductorApiError::from)
.map_err(Box::new)?;
// exit early if genesis has already run
if workspace.has_genesis(id.agent_pubkey().clone()).await? {
return Ok(());
}
let args = GenesisWorkflowArgs::new(
dna_file,
id.agent_pubkey().clone(),
membrane_proof,
ribosome,
dht_db_cache,
chc,
);
genesis_workflow(workspace, conductor_api, args)
.await
.map_err(ConductorApiError::from)
.map_err(Box::new)?;
if let Some(trigger) = conductor_handle
.get_queue_consumer_workflows()
.integration_trigger(Arc::new(id.dna_hash().clone()))
{
trigger.trigger(&"genesis");
}
Ok(())
}
sourcepub fn sys_validation_trigger(
&self,
dna_hash: Arc<DnaHash>
) -> Option<TriggerSender>
pub fn sys_validation_trigger(
&self,
dna_hash: Arc<DnaHash>
) -> Option<TriggerSender>
Get the sys validation trigger for this dna hash.
sourcepub fn app_validation_trigger(
&self,
dna_hash: Arc<DnaHash>
) -> Option<TriggerSender>
pub fn app_validation_trigger(
&self,
dna_hash: Arc<DnaHash>
) -> Option<TriggerSender>
Get the app validation trigger for this dna hash.
sourcepub fn countersigning_trigger(
&self,
dna_hash: Arc<DnaHash>
) -> Option<TriggerSender>
pub fn countersigning_trigger(
&self,
dna_hash: Arc<DnaHash>
) -> Option<TriggerSender>
Get the countersigning trigger for this dna hash.
Trait Implementations§
source§impl Clone for QueueConsumerMap
impl Clone for QueueConsumerMap
source§fn clone(&self) -> QueueConsumerMap
fn clone(&self) -> QueueConsumerMap
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for QueueConsumerMap
impl Send for QueueConsumerMap
impl Sync for QueueConsumerMap
impl Unpin for QueueConsumerMap
impl !UnwindSafe for QueueConsumerMap
Blanket Implementations§
§impl<T> Any for Twhere
T: Any + ?Sized,
impl<T> Any for Twhere
T: Any + ?Sized,
§fn type_id_compat(&self) -> TypeId
fn type_id_compat(&self) -> TypeId
TODO: once 1.33.0 is the minimum supported compiler version, remove
Any::type_id_compat and use StdAny::type_id instead.
https://github.com/rust-lang/rust/issues/27745
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
§impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
§fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.§impl<T> Upcastable for Twhere
T: 'static + Any + Send + Sync,
impl<T> Upcastable for Twhere
T: 'static + Any + Send + Sync,
§fn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
§fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref