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
### Keybase proof | |
I hereby claim: | |
* I am joliver on github. | |
* I am joliver (https://keybase.io/joliver) on keybase. | |
* I have a public key whose fingerprint is B834 EF94 BA73 68A1 C02B 48BD 9C02 4FBE AC5B 8FE9 | |
To claim this, I am signing this object: |
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
package main | |
import ( | |
"fmt" | |
"runtime" | |
"time" | |
) | |
// the code below is loosely based upon: https://gist.github.com/tux21b/1218360 | |
// it is only safe on 64-bit CPUs. |
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 EventDispatcher : IDispatchEvents | |
{ | |
private readonly IDictionary<Type, Action<IDomainEvent>> handlers = new Dictionary<Type, Action<IDomainEvent>>(); | |
public virtual void Register<TEvent>(Action<TEvent> handler) | |
where TEvent : class, IDomainEvent | |
{ | |
// re-wrap delegate | |
this.handlers[typeof(TEvent)] = @event => handler(@event as TEvent); | |
} |
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
private static void Main() | |
{ | |
IContainer container = null; // build container here | |
RegisterRoutes(container); // routes don't change | |
using (threadSpecificContainer = container.CreateInnerContainer()) | |
{ | |
var handler = new UnitOfWorkMessageHandler<IContainer>( | |
threadSpecificContainer, | |
new TransactionScope(), |
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
namespace Cqrs.Persistence | |
{ | |
using System; | |
using System.Collections.Generic; | |
using Domain; | |
public class DomainUnitOfWork : IUnitOfWork | |
{ | |
private readonly ICollection<IAggregate> inserted = new HashSet<IAggregate>(); | |
private readonly ICollection<IAggregate> updated = new HashSet<IAggregate>(); |
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
lib/jspec.xhr.js | 9 ++++++++- | |
1 files changed, 8 insertions(+), 1 deletions(-) | |
diff --git a/lib/jspec.xhr.js b/lib/jspec.xhr.js | |
index 482a3c4..f0a618a 100644 | |
--- a/lib/jspec.xhr.js | |
+++ b/lib/jspec.xhr.js | |
@@ -34,7 +34,14 @@ | |
*/ | |
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
lib/jspec.timers.js | 8 ++++---- | |
1 files changed, 4 insertions(+), 4 deletions(-) | |
diff --git a/lib/jspec.timers.js b/lib/jspec.timers.js | |
index c88d10b..82df7ad 100644 | |
--- a/lib/jspec.timers.js | |
+++ b/lib/jspec.timers.js | |
@@ -24,7 +24,7 @@ | |
* @api public | |
*/ |
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
namespace ConsoleApplication1 | |
{ | |
using System; | |
using System.Transactions; | |
using Raven.Client.Document; | |
public static class MainProgram | |
{ | |
private const string RavenUrl = "http://localhost:8080"; | |
private const string CustomDatabaseName = "MyDatabase"; |
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 void Test() | |
{ | |
var serializer = new Newtonsoft.Json.JsonSerializer(); | |
using (var memoryStream = new MemoryStream()) | |
{ | |
using (var bsonWriter = new BsonWriter(memoryStream)) | |
serializer.Serialize(bsonWriter, 12345); | |
Console.Write("Stream length is: " + memoryStream.Length); // shouldn't be *0*! |
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
return EventStore.Wireup.Init() | |
.UsingSqlPersistence("EventStore") | |
.InitializeDatabaseSchema() | |
.UsingCustomSerializer(new JsonSerializer()) | |
.Compress() | |
.EncryptWith(EncryptionKey) | |
.UsingAsynchronousDispatcher() | |
.PublishTo(new DelegateMessagePublisher(DispatchCommit)) | |
.HandleExceptionsWith(DispatchErrorHandler) | |
.Build(); |
OlderNewer