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 file="ChannelQueueWithBatch.cs" company="Akka.NET Project"> | |
| // Copyright (C) 2013-2023 .NET Foundation <https://github.com/akkadotnet/akka.net> | |
| // </copyright> | |
| // ----------------------------------------------------------------------- | |
| using System; | |
| using System.Threading; | |
| using System.Threading.Channels; | |
| 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
| using Akka.Annotations; | |
| using Akka.Streams.Dsl; | |
| using Akka.Streams.Implementation.Stages; | |
| using Akka.Streams.Stage; | |
| using Akka.Streams.Supervision; | |
| using Akka.Util; | |
| using Akka.Util.Internal; | |
| namespace Akka.Streams.NATS.KeyValueStore.AkkaStreamsExtensions; |
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.Runtime.CompilerServices; | |
| using System.Runtime.Serialization; | |
| namespace derp; | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| var obj = new object(); |
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.Text; | |
| using System.Threading.Tasks.Dataflow; | |
| using Akka; | |
| using Akka.Streams; | |
| using Akka.Streams.Dsl; | |
| using Akka.Streams.Implementation.Fusing; | |
| using Akka.Util; | |
| using JetBrains.Annotations; | |
| using NATS.Client.Core; | |
| using NATS.Client.JetStream; |
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.Linq; | |
| using System.Text; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| using Linq2Db.EfCore.Samples.Tests.Microsoft.EntityFrameworkCore.Infrastructure; | |
| using LinqToDB.Data; | |
| using LinqToDB.EntityFrameworkCore; | |
| using LinqToDB.Mapping; |
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
| //// THIS IS PROBABLY NOT QUITE WORKING IN A FEW WAYS, JUST A CONVERSATION STARTER AT THIS POINT | |
| /// <summary> | |
| /// INTERNAL API | |
| /// </summary> | |
| /// <typeparam name="TIn">TBD</typeparam> | |
| /// <typeparam name="TOut">TBD</typeparam> | |
| [InternalApi] | |
| public sealed class UnfoldAsync<TIn, TUnfoldState, TOut> : GraphStage<FlowShape<TIn, TOut>> | |
| { |
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 WatCache<T> where T : class | |
| { | |
| private static ConcurrentDictionary<object, Action<T,Guid>> _cache = new(); | |
| public static Action<T, Guid> Get(Expression<Func<T, object>> selector) => _cache.GetOrAdd(selector, sel => | |
| { | |
| var expr = (Expression<Func<T, object>>)sel; | |
| var member = expr.Body as MemberExpression; | |
| var prop = member!.Member as PropertyInfo; | |
| var ep = Expression.Parameter(typeof(T), "entity"); |
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.Net.Http; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| using Microsoft.Extensions.Http.Logging; | |
| using Microsoft.Extensions.Logging; | |
| namespace httplogging | |
| { |
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 ByteStringReadOnlySequenceSegment : ReadOnlySequenceSegment<byte> | |
| { | |
| public ByteStringReadOnlySequenceSegment(ReadOnlyMemory<byte> memory, long runningIndex) | |
| { | |
| Memory = memory; | |
| RunningIndex = runningIndex; | |
| } | |
| public static (ByteStringReadOnlySequenceSegment first, ByteStringReadOnlySequenceSegment last) Create(ByteString bs) | |
| { | |
| var bArr = bs.Buffers; |
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 NatsKVStore : INatsKVStore | |
| { | |
| public ValueTask<NatsKVEntry<T>> GetEntryAsync<T>(string key, ulong revision = default, INatsDeserialize<T>? serializer = default, CancellationToken cancellationToken = default) | |
| { | |
| ValidateKey(key); | |
| serializer ??= JetStreamContext.Connection.Opts.SerializerRegistry.GetDeserializer<T>(); | |
| var request = new StreamMsgGetRequest(); | |
| var keySubject = $"$KV.{Bucket}.{key}"; |
NewerOlder