Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
Add comment for coexistence of Pool::{new,new_dyn}
Browse files Browse the repository at this point in the history
  • Loading branch information
ryoqun committed Dec 13, 2023
1 parent 584bd35 commit b164f16
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions unified-scheduler-pool/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ pub type DefaultSchedulerPool =
SchedulerPool<PooledScheduler<DefaultTaskHandler>, DefaultTaskHandler>;

impl<S: SpawnableScheduler<TH>, TH: TaskHandler> SchedulerPool<S, TH> {
// Some internal impl and test code want an actual concrete type, NOT the
// `dyn InstalledSchedulerPool`. So don't merge this into `Self::new_dyn()`.
fn new(
log_messages_bytes_limit: Option<usize>,
transaction_status_sender: Option<TransactionStatusSender>,
Expand All @@ -90,6 +92,8 @@ impl<S: SpawnableScheduler<TH>, TH: TaskHandler> SchedulerPool<S, TH> {
})
}

// This apparently-meaningless wrapper is handy, because some callers explicitly want
// `dyn InstalledSchedulerPool` to be returned for type inference convenience.
pub fn new_dyn(
log_messages_bytes_limit: Option<usize>,
transaction_status_sender: Option<TransactionStatusSender>,
Expand Down

0 comments on commit b164f16

Please sign in to comment.