15#include <condition_variable>
65 public std::enable_shared_from_this<MissingBlocksUploader>
78 static std::shared_ptr<MissingBlocksUploader>
Create(
80 std::vector<BlockUploadTask> uploadTasks,
94 std::vector<BlockUploadTask> uploadTasks,
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Configuration for the audio.com.
size_t mConcurrentUploads
ProducedItem PopBlockFromQueue()
MissingBlocksUploadProgressCallback mProgressCallback
void HandleFailedBlock(const ResponseResult &result, BlockUploadTask task)
std::condition_variable mRingBufferNotFull
std::array< ProducedItem, RING_BUFFER_SIZE > mRingBuffer
std::atomic_bool mIsRunning
size_t mFirstUnprocessedBlockIndex
std::vector< BlockUploadTask > mUploadTasks
MissingBlocksUploader(Tag, const ServiceConfig &serviceConfig)
std::mutex mProgressDataMutex
size_t mRingBufferReadIndex
MissingBlocksUploadProgress mProgressData
ProducedItem ProduceBlock()
std::thread mConsumerThread
size_t mRingBufferWriteIndex
std::condition_variable mRingBufferNotEmpty
void PushBlockToQueue(ProducedItem item)
static std::shared_ptr< MissingBlocksUploader > Create(CancellationContextPtr cancellationContex, const ServiceConfig &serviceConfig, std::vector< BlockUploadTask > uploadTasks, MissingBlocksUploadProgressCallback progress)
void Start(CancellationContextPtr cancellationContex, std::vector< BlockUploadTask > uploadTasks, MissingBlocksUploadProgressCallback progress)
static constexpr auto RING_BUFFER_SIZE
const ServiceConfig & mServiceConfig
std::mutex mRingBufferMutex
void ConfirmBlock(BlockUploadTask task)
static constexpr auto NUM_PRODUCERS
std::thread mProducerThread[NUM_PRODUCERS]
CancellationContextPtr mCancellationContext
static constexpr auto NUM_UPLOADERS
std::condition_variable mUploadsNotFull
void ConsumeBlock(ProducedItem item)
std::function< void(const MissingBlocksUploadProgress &, const LockedBlock &, ResponseResult blockResponseResult)> MissingBlocksUploadProgressCallback
std::shared_ptr< CancellationContext > CancellationContextPtr
std::vector< ResponseResult > UploadErrors
std::vector< uint8_t > CompressedData