pub struct XetCommon {
pub file_ingestion_semaphore: Arc<Semaphore>,
pub file_download_semaphore: Arc<Semaphore>,
pub reconstruction_download_buffer: Arc<AdjustableSemaphore>,
pub active_downloads: Arc<AtomicU64>,
/* private fields */
}Expand description
Holds global values that are shared across the entire runtime.
Accessible via XetRuntime::current().common().
Fields§
§file_ingestion_semaphore: Arc<Semaphore>Limits the number of files being ingested (cleaned/uploaded) concurrently.
file_download_semaphore: Arc<Semaphore>Limits the number of files being downloaded concurrently.
reconstruction_download_buffer: Arc<AdjustableSemaphore>Limits total memory used for buffering data during reconstruction downloads.
active_downloads: Arc<AtomicU64>Tracks the number of currently active file downloads for dynamic buffer scaling.
Implementations§
Source§impl XetCommon
impl XetCommon
Sourcepub fn new(config: &XetConfig) -> Self
pub fn new(config: &XetConfig) -> Self
Creates a new XetCommon instance with the given configuration.
Sourcepub fn get_or_create_reqwest_client<F>(
&self,
tag: String,
create_client_fn: F,
) -> Result<Client>
pub fn get_or_create_reqwest_client<F>( &self, tag: String, create_client_fn: F, ) -> Result<Client>
Gets or creates a reqwest client, using a tag to identify the client type.
§Arguments
tag- A string identifier for the client (e.g., “tcp” for regular, socket path for UDS)create_client_fn- A function that creates the client if needed
§Returns
Returns a clone of the cached client if the tag matches, or creates a new client if the tag differs.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for XetCommon
impl RefUnwindSafe for XetCommon
impl Send for XetCommon
impl Sync for XetCommon
impl Unpin for XetCommon
impl UnsafeUnpin for XetCommon
impl UnwindSafe for XetCommon
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more