|
|
@@ -2,6 +2,8 @@
|
|
|
//! structures provide mechanisms for caching workers, sending transaction
|
|
|
//! batches, and gathering send transaction statistics.
|
|
|
|
|
|
+#[cfg(feature = "agave-unstable-api")]
|
|
|
+use qualifier_attr::qualifiers;
|
|
|
use {
|
|
|
crate::{
|
|
|
connection_worker::ConnectionWorker, logging::debug, transaction_batch::TransactionBatch,
|
|
|
@@ -71,6 +73,7 @@ impl WorkerInfo {
|
|
|
}
|
|
|
|
|
|
/// Spawns a worker to handle communication with a given peer.
|
|
|
+#[cfg_attr(feature = "agave-unstable-api", qualifiers(pub))]
|
|
|
pub(crate) fn spawn_worker(
|
|
|
endpoint: &Endpoint,
|
|
|
peer: &SocketAddr,
|
|
|
@@ -127,6 +130,7 @@ pub enum WorkersCacheError {
|
|
|
}
|
|
|
|
|
|
impl WorkersCache {
|
|
|
+ #[cfg_attr(feature = "agave-unstable-api", qualifiers(pub))]
|
|
|
pub(crate) fn new(capacity: usize, cancel: CancellationToken) -> Self {
|
|
|
Self {
|
|
|
workers: LruCache::new(capacity),
|
|
|
@@ -140,6 +144,7 @@ impl WorkersCache {
|
|
|
self.workers.contains(peer)
|
|
|
}
|
|
|
|
|
|
+ #[cfg_attr(feature = "agave-unstable-api", qualifiers(pub))]
|
|
|
pub(crate) fn push(
|
|
|
&mut self,
|
|
|
leader: SocketAddr,
|
|
|
@@ -266,6 +271,7 @@ impl WorkersCache {
|
|
|
///
|
|
|
/// The method awaits the completion of all shutdown tasks, ensuring that
|
|
|
/// each worker is properly terminated.
|
|
|
+ #[cfg_attr(feature = "agave-unstable-api", qualifiers(pub))]
|
|
|
pub(crate) async fn shutdown(&mut self) {
|
|
|
// Interrupt any outstanding `send_transactions()` calls.
|
|
|
self.cancel.cancel();
|