Skip to content

Instantly share code, notes, and snippets.

View dlyz's full-sized avatar

Dmitry Lyz dlyz

View GitHub Profile
@dlyz
dlyz / 01_SseParser.cs
Last active May 15, 2024 17:37
Server Sent Events parser impl close to proposal in https://github.com/dotnet/runtime/issues/98105
using System.Buffers;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
public readonly record struct SseItem<T>(
string EventType,
T Data,
string LastEventId,
TimeSpan ReconnectionInterval
#nullable enable
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Threading;
using Microsoft.Extensions.Primitives;
namespace Microsoft.Extensions.Primitives
{
using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.FileProviders.Physical;
using Microsoft.Extensions.Primitives;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
@dlyz
dlyz / SignalRSerializingBugRepro.cs
Created April 29, 2020 07:53
Exception thrown during serialization is not visible
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.SignalR;
using Microsoft.AspNetCore.SignalR.Client;