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
| 0eNrF3duOHdeRoOFXEXgtGjvyFBF+gAZ827czRoOiSnKhKZJTKhptGH73KUmWWB7VYq4ve4C+ctutCmXutQ9/Hvb+/v7qm3ef7j4+3L9/fPXHv7/69u7Htw/3Hx/vP7x/9cdXf3r/ePfw7sPb/7x///1X/3735u3jh4ev/u3N2/t3949/+8P/fv+n92/ffXr6k6/evXn/7Xf379599fSfX3389MPHH//w6utX928/vP/x1R//199f/Xj//fs37376Fzz+7ePd0+T7x7sfnv6J929++Om/vf/09t3dm4fXD7/8K1794+lv339791+v/hj/+PPXr+7eP94/3t/9Murn//K3/3j/6Ydv7h6e/oHfhnz47rsf//Lh4e71T//+p9kfP/x4/8t+/P3VT5Pq9of961d/e/q/9vUP+z/+8fXvZi3zs46zWev0rD7drm1+Vp3N2mdnLbfTfTx+m/Xj492bH14/fnr45v793QvblZ9nPf1fT8v77f3D3dtf/onlhck5PbnCJtdvkz/ef7x7/fjh9fcPHz69//bLT5jt5Qeg5zczbTPjBtt5nG1nxPy0Z0/HfTBt+ZdpX54x2qJ1+qHrHR+6DXa2Tjd0n93Q5XbDDT2mN/T5i3G0KnmyKs9njHa2pnc28HUXffakqe1fJr70/nyDGTmYEadP3uV0OxaYMdqO9XS51tPt2OAJtI3X63hp9rPn/advfnx88/M/+tKT6tf9fHEL5SmOb5HL+RO+TlehYMZoFT4/sx8+fPPh44eHx5c+AZdfphy3F2vhduWjtGcepjWufJbOjV7g9ViDTlqnnmdPH3K/btmLUzbYkh5syT7/QDU+UAe8YYw2L2HG6MGuK5+6c7vYVz4np0Zvt/nRuNVbwOt/sDDbAjMGC7OtVz5453Zxmx+Nby3bfuFd61imRh8X3rUmR+f8e8URg/UqmHEbzOgL7zdzu7jf5t8rRru4QyiNdnFfLrzfTO7ieuH9ZnL0duH9ZnL0Pv9eMVyYA2aMFiYvvN9M7mJdeL+ |
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
| class Queue | |
| { | |
| constructor() | |
| { | |
| this.count = 0; | |
| this.tail = this.root = { | |
| next:null | |
| }; | |
| } |
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
| static class LocalArrayPool<T> | |
| { | |
| public const int MaxArrayLength = 1024 * 1024; | |
| static LocalArrayPool() | |
| { | |
| Instance = ArrayPool<T>.Create(MaxArrayLength, 4); | |
| } | |
| public static readonly ArrayPool<T> Instance; | |
| public static void Rent( |
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.Collections.Generic; | |
| using System.Diagnostics.Contracts; | |
| using System.IO; | |
| namespace System.Threading.Tasks.Dataflow | |
| { | |
| public static class DataflowExtensions | |
| { | |
| public static BatchBlock<T> Batch<T>(this ISourceBlock<T> source, | |
| int batchSize, |
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 RequestLimitHandler : HttpClientHandler | |
| { | |
| readonly SemaphoreSlim Limiter; | |
| public RequestLimitHandler(int maxTotalRequests) | |
| { | |
| MaxTotalTotalRequests = maxTotalRequests; | |
| Limiter = new SemaphoreSlim(maxTotalRequests, maxTotalRequests); | |
| } | |
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 Extensions | |
| { | |
| public static void AddCacheControlHeader(this IHeaderDictionary target, string value) | |
| => target.Add("Cache-Control", value); | |
| public static void AddCacheControlHeader(this HttpResponse target, string value) | |
| => target.Headers.AddCacheControlHeader(value); | |
| public static void AddCacheControlResponseHeader(this HttpContext target, string value) | |
| => target.Response.AddCacheControlHeader(value); |
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 DataRowDictionary : IDictionary<string, object> | |
| { | |
| public readonly DataRow Row; | |
| public DataRowDictionary(DataRow row) | |
| { | |
| Row = row; | |
| } | |
| public object this[string key] { |
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 override String GetVaryByCustomString(HttpContext context, String args) | |
| { | |
| //context.Items["VaryByCustom"] = args; | |
| args = args?.Trim(';'); | |
| if (string.IsNullOrWhiteSpace(args)) return string.Empty; | |
| return String.Join(';', args.Split(';').Select(a => VaryByCustomStringOptionSingle(context, a)).ToArray()); | |
| } | |
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 struct CachingPolicy | |
| { | |
| public readonly ExpirationMode Mode; | |
| public readonly TimeSpan ExpiresAfter; | |
| public readonly CacheItemPriority Priority; | |
| private CachingPolicy(ExpirationMode mode, TimeSpan expiresAfter, CacheItemPriority priority) | |
| { | |
| Mode = mode; | |
| ExpiresAfter = expiresAfter; |
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.Numerics; | |
| using System.IO; | |
| using System.Diagnostics; | |
| using System.Threading.Tasks.Dataflow; | |
| using System.Threading.Tasks; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Collections.Concurrent; |