Skip to content

Commit

Permalink
Simplify storage of validation service
Browse files Browse the repository at this point in the history
The complexity is no longer needed, thanks to the simplified
subscription model.
  • Loading branch information
hannobraun committed Apr 26, 2023
1 parent e14393c commit 36e698d
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions crates/fj-kernel/src/services/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ mod objects;
mod service;
mod validation;

use std::sync::Arc;

use parking_lot::Mutex;

use crate::objects::{Object, Objects, WithHandle};

pub use self::{
Expand All @@ -28,14 +24,14 @@ pub struct Services {
/// The validation service
///
/// Validates objects that are inserted using the objects service.
pub validation: Arc<Mutex<Service<Validation>>>,
pub validation: Service<Validation>,
}

impl Services {
/// Construct an instance of `Services`
pub fn new() -> Self {
let objects = Service::<Objects>::default();
let validation = Arc::new(Mutex::new(Service::default()));
let validation = Service::default();

Self {
objects,
Expand All @@ -50,9 +46,7 @@ impl Services {
.execute(Operation::InsertObject { object }, &mut object_events);

for object_event in object_events {
self.validation
.lock()
.execute(object_event, &mut Vec::new());
self.validation.execute(object_event, &mut Vec::new());
}
}
}
Expand Down

0 comments on commit 36e698d

Please sign in to comment.