Skip to content

Instantly share code, notes, and snippets.

@to11mtm
to11mtm / NatsToyAppJetStream.cs
Created May 10, 2024 16:36
Nats Toy App, Jetstream Version
using System.Buffers;
using System.Collections.Concurrent;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Net.Sockets;
using System.Text;
using System.Threading.Channels;
using CommunityToolkit.HighPerformance.Buffers;
using Cysharp.Serialization.MessagePack;
using LanguageExt;
@to11mtm
to11mtm / NatsToyTaskAppSemiWorking.cs
Last active April 17, 2024 03:41
Nats Toy Task App, Round 4(+3), semi working with(out) replication/etc and a simple console interface!
using System.Buffers;
using System.Collections.Concurrent;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Net.Sockets;
using System.Text;
using System.Threading.Channels;
using CommunityToolkit.HighPerformance.Buffers;
using Cysharp.Serialization.MessagePack;
using LanguageExt;
@to11mtm
to11mtm / ToyNatsTaskAndChatAppInfra.cs
Last active April 8, 2024 00:01
Nats Sandbox Task tracking Logic, Round 2
using System.Buffers;
using System.Collections.Concurrent;
using System.Net.Sockets;
using System.Threading.Channels;
using Cysharp.Serialization.MessagePack;
using LanguageExt;
using LinqToDB;
using LinqToDB.Data;
using MessagePack;
using MessagePack.Resolvers;
@to11mtm
to11mtm / ToyNatsTaskAndChatAppInfra.cs
Created March 30, 2024 23:08
Just some playing around with making a 'toy' NATS app for Chat and Tasks
using System.Buffers;
using LanguageExt;
using MessagePack;
using NATS.Client.Core;
using NATS.Client.JetStream;
using NATS.Client.KeyValueStore;
using static LanguageExt.Prelude;
namespace NatsSandBox.Client;
@to11mtm
to11mtm / AkkaStreamsNatsCore.cs
Last active February 23, 2024 22:10
WIP of Akka streams Connectors for V2 Nats C# client.
using System.Text;
using Akka;
using Akka.Streams.Actors;
using Akka.Streams.Dsl;
using Akka.Streams.Implementation.Fusing;
using Akka.Util;
using NATS.Client.Core;
using NATS.Client.JetStream;
using NATS.Client.JetStream.Models;
using NATS.Client.KeyValueStore;
<Query Kind="Program">
<NuGetReference>Akka.Streams</NuGetReference>
<Namespace>Akka.Actor</Namespace>
<Namespace>Akka.Streams.Dsl</Namespace>
<Namespace>Akka.Streams</Namespace>
<Namespace>System.Collections.Immutable</Namespace>
<Namespace>System.Threading.Tasks</Namespace>
</Query>
async Task Main()
using System.Runtime.Serialization;
using System.Text.Json;
using Microsoft.Extensions.Primitives;
using NATS.Client.Core;
using NATS.Client.JetStream;
using NATS.Client.JetStream.Models;
using NATS.Client.KeyValueStore;
namespace NATSWrappers;
@to11mtm
to11mtm / AkkaStreamsDsl.cs
Created January 13, 2024 00:47
Nats Wrappers for Akka Streams
using Akka;
using Akka.Streams.Dsl;
using Akka.Util;
using NATS.Client.Core;
using NATS.Client.JetStream;
using NATS.Client.JetStream.Models;
using NATSWrappers;
namespace GlutenFree.Akka.Streams.nats_net_v2;
@to11mtm
to11mtm / AkkaStreamsValueTaskStuff.cs
Created January 11, 2024 01:37
Proposed slim semi-unsafe valuetask continuation pooling pattern for unfold stages in Akka Streams
using System;
using System.Threading;
using Akka.Streams.Stage;
using Akka.Annotations;
namespace Akka.Streams.Implementation
{
/// <summary>
/// Semi-unsafe Helper intermediate for <see cref="OutGraphStageLogic"/>
/// that allows for a ValueTask Wait to be pooled.
@to11mtm
to11mtm / SelectValueTaskAsync.cs
Created December 31, 2023 03:38
WIP Akka Streams ValueTask SelectAsync stage with Pooling
using System;
using System.Collections.Concurrent;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using System.Threading.Tasks.Sources;
using Akka.Annotations;
using Akka.Event;
using Akka.Streams.Stage;
using Akka.Streams.Supervision;
using Akka.Util;