示例#1
0
        private async Task FlushToBlobAsync()
        {
            var contractToSave = GetContractToSave();
            await _azurePageBlob.WriteAsProtobufAsync(contractToSave);

            Console.WriteLine("Last Compressed pages state is saved to disk");

            _hasDataToUpdate = false;
        }
示例#2
0
        public async ValueTask SaveAsync(IEnumerable <TopicAndQueuesSnapshotGrpcModel> snapshot)
        {
            await CreateIfNotExistsAsync();

            var dataToSave = new List <TopicAndQueuesBlobContract>();

            foreach (var topicData in snapshot)
            {
                var topicDataToSave = TopicAndQueuesBlobContract.Create(topicData);
                dataToSave.Add(topicDataToSave);
            }

            await _azurePageBlob.WriteAsProtobufAsync(dataToSave);
        }