This file contains 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 Template | |
{ | |
private static Logger _logger = LogManager.GetCurrentClassLogger(); | |
public readonly string Body; | |
private HashSet<string> _keys; | |
public const string KeyExpression = @"{(?<key>[^}]+)}"; | |
public bool RenderEmptyStringForMissingKeys { get; set; } |
This file contains 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
TplNetEngine`1 | |
# commands: 40000 | |
# commands per batch: 5120 | |
time elapsed: 00:00:00.4124693 | |
tps: 96976,9144030841 | |
AkkaEngine`1 | |
# commands: 40000 | |
# commands per batch: 5120 | |
time elapsed: 00:00:01.0080653 |
This file contains 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
TplNetEngine`1 | |
# commands: 20000 | |
# commands per batch: 1280 | |
time elapsed: 00:00:00.3238584 | |
tps: 61755,3844519704 | |
AkkaEngine`1 | |
# commands: 20000 | |
# commands per batch: 1280 | |
time elapsed: 00:00:00.4505049 |
This file contains 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
[Test] | |
public void ESConnectTest() | |
{ | |
var endPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 1113); | |
var connection = EventStoreConnection.Create(endPoint); | |
bool connected = false; | |
connection.Connected += (sender, args) => connected = true; | |
connection.ConnectAsync().Wait(); | |
Assert.IsTrue(connected); | |
} |
This file contains 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 EventStoreWriter : IJournalWriter | |
{ | |
private readonly IEventStoreConnection _eventStore; | |
private readonly IFormatter _formatter; | |
public EventStoreWriter(IEventStoreConnection connection, IFormatter formatter = null) | |
{ | |
_formatter = formatter ?? new BinaryFormatter(); | |
_eventStore = connection; | |
} |
This file contains 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.Linq; | |
using System.Net; | |
using System.Threading.Tasks; | |
using System.Threading.Tasks.Dataflow; | |
using Disruptor; | |
using Disruptor.Dsl; | |
using EventStore.ClientAPI; | |
namespace AckAck.Disruptive |
This file contains 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 async Task<R> ExecuteAsync<R>(Command<M, R> command) | |
{ | |
var completion = new WriteOnceBlock<object>(_ => _); | |
_commandQueue.PublishEvent((e, i) => | |
{ | |
e.Transaction = command; | |
e.Result = completion; | |
return e; | |
}); |
This file contains 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 Journaler : IEventHandler<BufferEntry> | |
{ | |
private BufferEntry[] _buffer = new BufferEntry[1024]; | |
private int _current; | |
private IJournalWriter _journal; | |
public Journaler(IJournalWriter journal) | |
{ | |
_journal = journal; | |
} |
This file contains 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 Dispatcher | |
{ | |
private Kernel _kernel; | |
readonly BufferBlock<CommandContext[]> _commandQueue; | |
readonly BatchBlock<QueryContext> _queryQueue; | |
readonly ActionBlock<object> _executor; | |
readonly Timer _timer; | |
/// <summary> | |
/// Maximum latency for queries |
This file contains 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
{ "element" : "object", | |
"namespace" : "json", | |
"childNodes" : [ | |
{ | |
"type" : "element" | |
"name": "string", | |
"namespace" : "json", | |
"attributes" : [ | |
{ |