mirror of
https://github.com/salsa-rs/salsa.git
synced 2025-01-13 00:40:22 +00:00
name the field runtime_id
This commit is contained in:
parent
cf9db9cc7f
commit
2e3f8b1a3d
4 changed files with 11 additions and 11 deletions
|
@ -315,7 +315,7 @@ where
|
|||
);
|
||||
|
||||
db.salsa_event(|| Event {
|
||||
id: runtime.id(),
|
||||
runtime_id: runtime.id(),
|
||||
kind: EventKind::DidValidateMemoizedValue {
|
||||
descriptor: descriptor.clone(),
|
||||
},
|
||||
|
@ -464,9 +464,9 @@ where
|
|||
std::mem::drop(map);
|
||||
|
||||
db.salsa_event(|| Event {
|
||||
id: db.salsa_runtime().id(),
|
||||
runtime_id: db.salsa_runtime().id(),
|
||||
kind: EventKind::WillBlockOn {
|
||||
other_id,
|
||||
other_runtime_id: other_id,
|
||||
descriptor: descriptor.clone(),
|
||||
},
|
||||
});
|
||||
|
|
|
@ -84,7 +84,7 @@ where
|
|||
let mut map = self.map.write();
|
||||
|
||||
db.salsa_event(|| Event {
|
||||
id: db.salsa_runtime().id(),
|
||||
runtime_id: db.salsa_runtime().id(),
|
||||
kind: EventKind::WillChangeInputValue {
|
||||
descriptor: descriptor.clone(),
|
||||
},
|
||||
|
|
12
src/lib.rs
12
src/lib.rs
|
@ -73,14 +73,14 @@ pub trait Database: plumbing::DatabaseStorageTypes + plumbing::DatabaseOps {
|
|||
}
|
||||
|
||||
pub struct Event<DB: Database> {
|
||||
pub id: RuntimeId,
|
||||
pub runtime_id: RuntimeId,
|
||||
pub kind: EventKind<DB>,
|
||||
}
|
||||
|
||||
impl<DB: Database> fmt::Debug for Event<DB> {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
fmt.debug_struct("Event")
|
||||
.field("id", &self.id)
|
||||
.field("runtime_id", &self.runtime_id)
|
||||
.field("kind", &self.kind)
|
||||
.finish()
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ pub enum EventKind<DB: Database> {
|
|||
/// Executes before the "re-used" value is returned.
|
||||
DidValidateMemoizedValue { descriptor: DB::QueryDescriptor },
|
||||
|
||||
/// Indicates that another thread (with id `other_id`) is processing the
|
||||
/// Indicates that another thread (with id `other_runtime_id`) is processing the
|
||||
/// given query (`descriptor`), so we will block until they
|
||||
/// finish.
|
||||
///
|
||||
|
@ -104,7 +104,7 @@ pub enum EventKind<DB: Database> {
|
|||
/// (NB: you can find the `id` of the current thread via the
|
||||
/// `salsa_runtime`)
|
||||
WillBlockOn {
|
||||
other_id: RuntimeId,
|
||||
other_runtime_id: RuntimeId,
|
||||
descriptor: DB::QueryDescriptor,
|
||||
},
|
||||
|
||||
|
@ -126,11 +126,11 @@ impl<DB: Database> fmt::Debug for EventKind<DB> {
|
|||
.field("descriptor", descriptor)
|
||||
.finish(),
|
||||
EventKind::WillBlockOn {
|
||||
other_id,
|
||||
other_runtime_id,
|
||||
descriptor,
|
||||
} => fmt
|
||||
.debug_struct("WillBlockOn")
|
||||
.field("other_id", other_id)
|
||||
.field("other_runtime_id", other_runtime_id)
|
||||
.field("descriptor", descriptor)
|
||||
.finish(),
|
||||
EventKind::WillChangeInputValue { descriptor } => fmt
|
||||
|
|
|
@ -258,7 +258,7 @@ where
|
|||
debug!("{:?}: execute_query_implementation invoked", descriptor);
|
||||
|
||||
db.salsa_event(|| Event {
|
||||
id: db.salsa_runtime().id(),
|
||||
runtime_id: db.salsa_runtime().id(),
|
||||
kind: EventKind::WillExecute {
|
||||
descriptor: descriptor.clone(),
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue