Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Shitty containers and race conditions suck ass

  • Loading branch information...
commit e14a23be7596099d7f48236e8358c67aec93e05b 1 parent 1cd9b6d
@phatboyg phatboyg authored
View
7 src/Containers/MassTransit.Containers.Tests/Ninject_Specs.cs
@@ -23,6 +23,7 @@ public class Ninject_Consumer :
When_registering_a_consumer
{
readonly IKernel _container;
+ SimpleConsumer _simpleConsumer;
public Ninject_Consumer()
{
@@ -33,6 +34,8 @@ public Ninject_Consumer()
_container.Bind<AnotherMessageConsumer>()
.To<AnotherMessageConsumerImpl>()
.InSingletonScope();
+
+ _simpleConsumer = _container.Get<SimpleConsumer>();
}
[Finally]
@@ -45,12 +48,12 @@ protected override void SubscribeLocalBus(SubscriptionBusServiceConfigurator sub
{
// we have to do this explicitly, since the metadata is not exposed by Ninject
subscriptionBusServiceConfigurator.Consumer<SimpleConsumer>(_container);
- subscriptionBusServiceConfigurator.Consumer<AnotherMessageConsumerImpl>(_container);
+ subscriptionBusServiceConfigurator.Consumer<AnotherMessageConsumer>(_container);
}
protected override SimpleConsumer GetSimpleConsumer()
{
- return _container.Get<SimpleConsumer>();
+ return _simpleConsumer;
}
}
View
2  src/Containers/MassTransit.Containers.Tests/Scenarios/AnotherMessageConsumerImpl.cs
@@ -24,6 +24,8 @@ public class AnotherMessageConsumerImpl :
public AnotherMessageConsumerImpl()
{
+ Console.WriteLine("AnotherMessageConsumer()");
+
_received = new ManualResetEvent(false);
}
View
2  src/Containers/MassTransit.Containers.Tests/Scenarios/SimpleConsumer.cs
@@ -24,6 +24,8 @@ public class SimpleConsumer :
public SimpleConsumer()
{
+ Console.WriteLine("SimpleConsumer()");
+
_received = new ManualResetEvent(false);
}

1 comment on commit e14a23b

@ahjohannessen

+1 for awesome commit message :D

Btw, just started doing CQRS with EventStore and MassTransit!

Please sign in to comment.
Something went wrong with that request. Please try again.