tosnativeclient 1.0.5__tar.gz → 1.0.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of tosnativeclient might be problematic. Click here for more details.
- {tosnativeclient-1.0.5 → tosnativeclient-1.0.6}/Cargo.lock +1 -1
- {tosnativeclient-1.0.5 → tosnativeclient-1.0.6}/Cargo.toml +1 -1
- {tosnativeclient-1.0.5 → tosnativeclient-1.0.6}/PKG-INFO +1 -1
- {tosnativeclient-1.0.5 → tosnativeclient-1.0.6}/src/read_stream.rs +11 -4
- {tosnativeclient-1.0.5 → tosnativeclient-1.0.6}/.github/workflows/CI.yml +0 -0
- {tosnativeclient-1.0.5 → tosnativeclient-1.0.6}/.gitignore +0 -0
- {tosnativeclient-1.0.5 → tosnativeclient-1.0.6}/build.sh +0 -0
- {tosnativeclient-1.0.5 → tosnativeclient-1.0.6}/pyproject.toml +0 -0
- {tosnativeclient-1.0.5 → tosnativeclient-1.0.6}/python/tosnativeclient/__init__.py +0 -0
- {tosnativeclient-1.0.5 → tosnativeclient-1.0.6}/python/tosnativeclient/tosnativeclient.pyi +0 -0
- {tosnativeclient-1.0.5 → tosnativeclient-1.0.6}/src/lib.rs +0 -0
- {tosnativeclient-1.0.5 → tosnativeclient-1.0.6}/src/list_stream.rs +0 -0
- {tosnativeclient-1.0.5 → tosnativeclient-1.0.6}/src/tos_client.rs +0 -0
- {tosnativeclient-1.0.5 → tosnativeclient-1.0.6}/src/tos_error.rs +0 -0
- {tosnativeclient-1.0.5 → tosnativeclient-1.0.6}/src/tos_model.rs +0 -0
- {tosnativeclient-1.0.5 → tosnativeclient-1.0.6}/src/tos_raw_client.rs +0 -0
- {tosnativeclient-1.0.5 → tosnativeclient-1.0.6}/src/write_stream.rs +0 -0
|
@@ -11,6 +11,7 @@ use std::sync::atomic::{AtomicI8, AtomicIsize, Ordering};
|
|
|
11
11
|
use std::sync::Arc;
|
|
12
12
|
use tokio::runtime::{Handle, Runtime};
|
|
13
13
|
use tokio::sync::{Mutex, MutexGuard};
|
|
14
|
+
use tokio::task::JoinHandle;
|
|
14
15
|
use tracing::log::{error, warn};
|
|
15
16
|
use ve_tos_rust_sdk::asynchronous::object::ObjectAPI;
|
|
16
17
|
use ve_tos_rust_sdk::error::TosError;
|
|
@@ -341,9 +342,9 @@ impl ObjectFetcher {
|
|
|
341
342
|
return None;
|
|
342
343
|
}
|
|
343
344
|
|
|
344
|
-
let task = self.new_fetch_task(fc);
|
|
345
|
+
let mut task = self.new_fetch_task(fc);
|
|
345
346
|
self.revise_next_request_offset_and_size(fc, task.size);
|
|
346
|
-
task.async_fetch(self.client.clone(), runtime);
|
|
347
|
+
task.wait_async_fetch = Some(task.async_fetch(self.client.clone(), runtime));
|
|
347
348
|
Some(task)
|
|
348
349
|
}
|
|
349
350
|
|
|
@@ -512,6 +513,7 @@ impl ObjectFetcher {
|
|
|
512
513
|
chunk_queue: Arc::new(ChunkQueue::new(self.calc_chunk_queue_size() as usize)),
|
|
513
514
|
last_chunk: ChunkHolder::new(None),
|
|
514
515
|
closed: self.closed.clone(),
|
|
516
|
+
wait_async_fetch: None,
|
|
515
517
|
}
|
|
516
518
|
}
|
|
517
519
|
|
|
@@ -537,6 +539,7 @@ impl ObjectFetcher {
|
|
|
537
539
|
chunk_queue: Arc::new(ChunkQueue::new(chunks.len())),
|
|
538
540
|
last_chunk: ChunkHolder { inner: None },
|
|
539
541
|
closed: self.closed.clone(),
|
|
542
|
+
wait_async_fetch: None,
|
|
540
543
|
};
|
|
541
544
|
|
|
542
545
|
for chunk in chunks {
|
|
@@ -653,6 +656,7 @@ struct FetchTask {
|
|
|
653
656
|
chunk_queue: Arc<ChunkQueue>,
|
|
654
657
|
last_chunk: ChunkHolder,
|
|
655
658
|
closed: Arc<AtomicI8>,
|
|
659
|
+
wait_async_fetch: Option<JoinHandle<()>>,
|
|
656
660
|
}
|
|
657
661
|
|
|
658
662
|
impl FetchTask {
|
|
@@ -666,12 +670,12 @@ impl FetchTask {
|
|
|
666
670
|
self.start_offset + self.fetched_size.load(Ordering::Acquire)
|
|
667
671
|
}
|
|
668
672
|
|
|
669
|
-
fn async_fetch(&self, client: Arc<InnerTosClient>, runtime: Arc<Runtime>) {
|
|
673
|
+
fn async_fetch(&self, client: Arc<InnerTosClient>, runtime: Arc<Runtime>) -> JoinHandle<()> {
|
|
670
674
|
let fetch_task_context = FetchTaskContext::new(self, client);
|
|
671
675
|
runtime.spawn(async move {
|
|
672
676
|
fetch_task_context.fetch_from_server().await;
|
|
673
677
|
fetch_task_context.chunk_queue.close();
|
|
674
|
-
})
|
|
678
|
+
})
|
|
675
679
|
}
|
|
676
680
|
|
|
677
681
|
async fn read(&mut self, length: isize) -> Option<Chunk> {
|
|
@@ -716,6 +720,9 @@ impl FetchTask {
|
|
|
716
720
|
self.shared_prefetch_task.fetch_add(-1, Ordering::Release);
|
|
717
721
|
self.pcontext.release_shared_prefetch_task();
|
|
718
722
|
}
|
|
723
|
+
if let Some(wait_execute) = self.wait_async_fetch.take() {
|
|
724
|
+
let _ = wait_execute.await;
|
|
725
|
+
}
|
|
719
726
|
}
|
|
720
727
|
}
|
|
721
728
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|