New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a separate crate for workunit_store #7855
Create a separate crate for workunit_store #7855
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good :) Just some superficial minor changes
src/rust/engine/src/lib.rs
Outdated
@@ -75,6 +77,7 @@ use crate::handles::Handle; | |||
use crate::scheduler::{ExecutionRequest, RootResult, Scheduler, Session}; | |||
use crate::tasks::{Rule, Tasks}; | |||
use crate::types::Types; | |||
use crate::workunit_store::WorkUnitStore; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use crate::workunit_store::WorkUnitStore; | |
use workunit_store::WorkUnitStore; |
We generally use crate::
to point at things which are defined in this crate, whereas workunit_store
is an external crate.
src/rust/engine/src/lib.rs
Outdated
@@ -51,6 +51,8 @@ use log; | |||
|
|||
use tar_api; | |||
|
|||
use workunit_store; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this line (and the newline after it) can be removed after my suggestion below.
src/rust/engine/src/nodes.rs
Outdated
@@ -19,6 +19,7 @@ use crate::core::{throw, Failure, Key, Params, TypeId, Value}; | |||
use crate::externs; | |||
use crate::selectors; | |||
use crate::tasks::{self, Intrinsic, Rule}; | |||
use crate::workunit_store::{WorkUnit, WorkUnitStore}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use crate::workunit_store::{WorkUnit, WorkUnitStore}; | |
use workunit_store::{WorkUnit, WorkUnitStore}; |
src/rust/engine/src/scheduler.rs
Outdated
@@ -13,6 +13,7 @@ use futures::future::{self, Future}; | |||
use crate::context::{Context, Core}; | |||
use crate::core::{Failure, Params, TypeId, Value}; | |||
use crate::nodes::{NodeKey, Select, Tracer, Visualizer}; | |||
use crate::workunit_store::{WorkUnit, WorkUnitStore}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use crate::workunit_store::{WorkUnit, WorkUnitStore}; | |
use workunit_store::{WorkUnit, WorkUnitStore}; |
We are decoupling `Session` from `WorkUnit` related structure. - Create workunit_store crate - Extract WorkUnit and WorkUnitStore traits from `Session` - Implement `WorkUnitStore` trait for `Session`
We are decoupling
Session
fromWorkUnit
related structure.Session
WorkUnitStore
trait forSession