Skip to content

Commit

Permalink
CR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
fulmicoton committed Aug 20, 2023
1 parent f1cfeab commit 7ad9d3c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion quickwit/quickwit-actors/src/actor_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ pub struct ActorContextInner<A: Actor> {
actor_state: AtomicState,
backpressure_micros_counter_opt: Option<IntCounter>,
observable_state_tx: watch::Sender<A::ObservableState>,
// Counter that gets incremented after each observation.
// Boolean marking the presence of an observe message in the actor's high priority queue.
observe_enqueued: AtomicBool,
}

Expand Down
23 changes: 12 additions & 11 deletions quickwit/quickwit-actors/src/actor_handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,17 @@ impl<A: Actor> ActorHandle<A> {
self.observe_with_priority(Priority::High).await
}

// Triggers an observation.
// It is scheduled as a high priority
// message, and will hence be executed as soon as possible.
//
// This method does not enqueue an Observe requests if one is already enqueue.
//
// The resulting observation can eventually be accessible using the
// observation watch channel.
//
// This function returning does NOT mean that the observation was executed.
/// Triggers an observation.
/// It is scheduled as a high priority
/// message, and will hence be executed as soon as possible.
///
/// This method does not enqueue an Observe request if there is already one in
/// the queue.
///
/// The resulting observation can eventually be accessible using the
/// observation watch channel.
///
/// This function returning does NOT mean that the observation was executed.
pub fn refresh_observe(&self) {
let observation_already_enqueued = self
.actor_context
Expand Down Expand Up @@ -422,7 +423,7 @@ mod tests {
let universe = Universe::new();
let (_, actor_handle) = universe.spawn_builder().spawn(ObserveActor::default());
for _ in 0..10 {
let _ = actor_handle.refresh_observe();
actor_handle.refresh_observe();
universe.sleep(Duration::from_millis(10)).await;
}
let (_last_obs, num_obs) = actor_handle.quit().await;
Expand Down

0 comments on commit 7ad9d3c

Please sign in to comment.