var state = new State();
var queue = new QueueClient();
try
{
var item = await queue.DequeueAsync();
state.Item = item;
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.AspNetCore.WebUtilities; | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.Hosting; | |
namespace WebApplication404 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Buffers; | |
using System.IO; | |
using System.Text; | |
using BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Diagnosers; | |
using BenchmarkDotNet.Running; | |
namespace MyBenchmarks | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Text.Json; | |
using System.Threading.Tasks; | |
using Microsoft.Azure.ServiceBus; | |
namespace ConsoleApp60 | |
{ | |
class Program | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.Extensions.Hosting; | |
public class Program | |
{ | |
public static void Main(string[] args) => | |
Host.CreateDefaultBuilder(args) | |
.ConfigureWebHostDefaults(webBuilder => |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class NamedPipeConnectionListener : IConnectionListener | |
{ | |
private readonly NamedPipeEndPoint _endpoint; | |
private readonly CancellationTokenSource _listeningSource = new CancellationTokenSource(); | |
public NamedPipeConnectionListener(NamedPipeEndPoint endpoint) | |
{ | |
_endpoint = endpoint; | |
ListeningToken = _listeningSource.Token; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DuplexPipe<TStream> : Stream, IDuplexPipe where TStream : Stream | |
{ | |
private readonly IDuplexPipe _duplexPipe; | |
public DuplexPipe(IDuplexPipe duplexPipe, Func<Stream, TStream> wrapper) | |
{ | |
_duplexPipe = duplexPipe; | |
Stream = wrapper(this); | |
Input = PipeReader.Create(Stream); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) .NET Foundation. All rights reserved. | |
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | |
using System; | |
using System.Buffers; | |
using System.Collections.Concurrent; | |
using System.Collections.Generic; | |
using System.Net; | |
using System.Threading; | |
using System.Threading.Tasks; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class FormReaderExtensions | |
{ | |
public static async ValueTask<IFormCollection> ReadFormAsync2(this HttpRequest request) | |
{ | |
var reader = request.BodyPipe; | |
KeyValueAccumulator accumulator = default; | |
while (true) | |
{ | |
var result = await reader.ReadAsync(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"runtimeTarget": { | |
"name": ".NETCoreApp,Version=v3.0", | |
"signature": "22c69940c9b25639e4f75123b23a701826ae1b1a" | |
}, | |
"compilationOptions": { | |
"defines": [ | |
"TRACE", | |
"DEBUG", | |
"NETCOREAPP", |