コード例 #1
0
ファイル: BlockFactory.cs プロジェクト: tuga1975/Taskling.NET
        private ProtoListBlock GenerateListBlock(ListBlockRequest blockRequest, List <string> values)
        {
            var request = new ListBlockCreateRequest(new TaskId(blockRequest.ApplicationName, blockRequest.TaskName),
                                                     blockRequest.TaskExecutionId,
                                                     values,
                                                     blockRequest.SerializedHeader,
                                                     blockRequest.CompressionThreshold);

            var listBlock = _blockRepository.AddListBlock(request).Block;

            Thread.Sleep(5); // guarantee that each block has a unique created date
            return(listBlock);
        }
コード例 #2
0
ファイル: BlockFactory.cs プロジェクト: ruo2012/Taskling.NET
        private async Task <ProtoListBlock> GenerateListBlockAsync(ListBlockRequest blockRequest, List <string> values)
        {
            var request = new ListBlockCreateRequest(new TaskId(blockRequest.ApplicationName, blockRequest.TaskName),
                                                     blockRequest.TaskExecutionId,
                                                     values,
                                                     blockRequest.SerializedHeader,
                                                     blockRequest.CompressionThreshold);

            var listBlock = (await _blockRepository.AddListBlockAsync(request).ConfigureAwait(false)).Block;
            await Task.Delay(10).ConfigureAwait(false); // guarantee that each block has a unique created date

            return(listBlock);
        }