Skip to content

Commit

Permalink
Minor update to OperationStateManager API
Browse files Browse the repository at this point in the history
Makes convenience type for stream of action state results accessible
from from the outside functions that will return it. Additionally
changes filtering operations to be an async function so that blocking
will not have to be used when getting the actions to filter is an async
operation.
  • Loading branch information
zbirenbaum committed Jun 3, 2024
1 parent da2c4a7 commit b8014e0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions nativelink-scheduler/src/operation_state_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ pub struct OperationFilter {
pub unique_qualifier: Option<ActionInfoHashKey>,
}

type ActionStateResultStream = Pin<Box<dyn Stream<Item = Arc<dyn ActionStateResult>> + Send>>;
pub type ActionStateResultStream = Pin<Box<dyn Stream<Item = Arc<dyn ActionStateResult>> + Send>>;

#[async_trait]
pub trait ClientStateManager {
Expand Down Expand Up @@ -108,7 +108,7 @@ pub trait WorkerStateManager {
#[async_trait]
pub trait MatchingEngineStateManager {
/// Returns a stream of operations that match the filter.
fn filter_operations(&self, filter: OperationFilter) -> Result<ActionStateResultStream, Error>;
async fn filter_operations(&self, filter: OperationFilter) -> Result<ActionStateResultStream, Error>;

/// Update that state of an operation.
async fn update_operation(
Expand Down

0 comments on commit b8014e0

Please sign in to comment.