Permalink
Browse files

Renamed INewMessageBus to IMessageBus.

  • Loading branch information...
1 parent d35e8fc commit 4416f650d14af05710927c23399f88a063b5e23a @davidfowl davidfowl committed Sep 7, 2012
View
@@ -25,4 +25,5 @@ PublishProfiles/
*.ncrunchsolution
*.log
SignalR.Client.JS.Tests/temp/*
-SignalR.Client.JS.Tests/CommandLineBridge.js
+SignalR.Client.JS.Tests/CommandLineBridge.js
+*.vspx
@@ -119,7 +119,7 @@ public static void StressGroups()
if (!countDown.Wait(TimeSpan.FromSeconds(10)))
{
Console.WriteLine("Didn't receive " + max + " messages. Got " + (max - countDown.Count) + " missed (" + String.Join(",", list.Select(i => i.ToString())) + ")");
- var bus = host.DependencyResolver.Resolve<INewMessageBus>();
+ var bus = host.DependencyResolver.Resolve<IMessageBus>();
Debugger.Break();
}
}
@@ -139,7 +139,7 @@ private static void RunConnectionTest()
string payload = GetPayload();
var dr = new DefaultDependencyResolver();
- MeasureStats((MessageBus)dr.Resolve<INewMessageBus>());
+ MeasureStats((MessageBus)dr.Resolve<IMessageBus>());
var connectionManager = new ConnectionManager(dr);
var context = connectionManager.GetConnectionContext<StressConnection>();
@@ -176,7 +176,7 @@ private static void RunMemoryHost()
string payload = GetPayload();
- MeasureStats((MessageBus)host.DependencyResolver.Resolve<INewMessageBus>());
+ MeasureStats((MessageBus)host.DependencyResolver.Resolve<IMessageBus>());
Action<PersistentResponse> handler = (r) =>
{
@@ -234,7 +234,7 @@ private static void RunConnectionReceiveLoopTest()
string payload = GetPayload();
var dr = new DefaultDependencyResolver();
- MeasureStats((MessageBus)dr.Resolve<INewMessageBus>());
+ MeasureStats((MessageBus)dr.Resolve<IMessageBus>());
var connectionManager = new ConnectionManager(dr);
var context = connectionManager.GetConnectionContext<StressConnection>();
@@ -9,7 +9,7 @@ public class ConnectionFacts
[Fact]
public void SendingCommandObjectSetsCommandOnBus()
{
- var messageBus = new Mock<INewMessageBus>();
+ var messageBus = new Mock<IMessageBus>();
Message message = null;
messageBus.Setup(m => m.Publish(It.IsAny<Message>())).Callback<Message>(m => message = m);
var serializer = new JsonNetSerializer();
@@ -113,14 +113,14 @@ private class ServerNode
private IConnection _connection;
- public ServerNode(INewMessageBus bus)
+ public ServerNode(IMessageBus bus)
{
// Give each server it's own dependency resolver
Server = new MemoryHost(new DefaultDependencyResolver());
Connection = new FarmConnection();
Server.DependencyResolver.Register(typeof(FarmConnection), () => Connection);
- Server.DependencyResolver.Register(typeof(INewMessageBus), () => bus);
+ Server.DependencyResolver.Register(typeof(IMessageBus), () => bus);
var context = Server.ConnectionManager.GetConnectionContext<FarmConnection>();
_connection = context.Connection;
@@ -10,7 +10,7 @@ namespace SignalR
{
public class Connection : IConnection, ITransportConnection, ISubscriber
{
- private readonly INewMessageBus _bus;
+ private readonly IMessageBus _bus;
private readonly IJsonSerializer _serializer;
private readonly string _baseSignal;
private readonly string _connectionId;
@@ -20,7 +20,7 @@ public class Connection : IConnection, ITransportConnection, ISubscriber
private bool _aborted;
private readonly Lazy<TraceSource> _traceSource;
- public Connection(INewMessageBus newMessageBus,
+ public Connection(IMessageBus newMessageBus,
IJsonSerializer jsonSerializer,
string baseSignal,
string connectionId,
@@ -75,7 +75,7 @@ private IConnection GetConnection(string connectionName)
// Give this a unique id
var connectionId = Guid.NewGuid().ToString();
- return new Connection(_resolver.Resolve<INewMessageBus>(),
+ return new Connection(_resolver.Resolve<IMessageBus>(),
_resolver.Resolve<IJsonSerializer>(),
connectionName,
connectionId,
@@ -30,8 +30,8 @@ private void RegisterDefaultServices()
var serverMessageHandler = new Lazy<IServerCommandHandler>(() => new ServerCommandHandler(this));
Register(typeof(IServerCommandHandler), () => serverMessageHandler.Value);
- var newMessageBus = new Lazy<INewMessageBus>(() => new MessageBus(this));
- Register(typeof(INewMessageBus), () => newMessageBus.Value);
+ var newMessageBus = new Lazy<IMessageBus>(() => new MessageBus(this));
+ Register(typeof(IMessageBus), () => newMessageBus.Value);
var serializer = new Lazy<JsonNetSerializer>();
Register(typeof(IJsonSerializer), () => serializer.Value);
@@ -10,7 +10,7 @@ namespace SignalR.Infrastructure
/// </summary>
public class ServerCommandHandler : IServerCommandHandler, ISubscriber
{
- private readonly INewMessageBus _messageBus;
+ private readonly IMessageBus _messageBus;
private readonly IServerIdManager _serverIdManager;
private readonly IJsonSerializer _serializer;
private const int MaxMessages = 10;
@@ -20,14 +20,14 @@ public class ServerCommandHandler : IServerCommandHandler, ISubscriber
private static readonly string[] ServerSignals = new[] { ServerSignal };
public ServerCommandHandler(IDependencyResolver resolver) :
- this(resolver.Resolve<INewMessageBus>(),
+ this(resolver.Resolve<IMessageBus>(),
resolver.Resolve<IServerIdManager>(),
resolver.Resolve<IJsonSerializer>())
{
}
- public ServerCommandHandler(INewMessageBus messageBus, IServerIdManager serverIdManager, IJsonSerializer serializer)
+ public ServerCommandHandler(IMessageBus messageBus, IServerIdManager serverIdManager, IJsonSerializer serializer)
{
_messageBus = messageBus;
_serverIdManager = serverIdManager;
@@ -4,14 +4,13 @@
namespace SignalR
{
- public interface INewMessageBus
+ public interface IMessageBus
{
/// <summary>
///
/// </summary>
- /// <param name="source"></param>
- /// <param name="eventKey"></param>
- /// <param name="value"></param>
+ /// <param name="message"></param>
+ /// <returns></returns>
Task Publish(Message message);
/// <summary>
@@ -20,6 +19,7 @@ public interface INewMessageBus
/// <param name="subscriber"></param>
/// <param name="cursor"></param>
/// <param name="callback"></param>
+ /// <param name="maxMessages"></param>
/// <returns></returns>
IDisposable Subscribe(ISubscriber subscriber, string cursor, Func<MessageResult, Task<bool>> callback, int maxMessages);
@@ -14,7 +14,7 @@ namespace SignalR
/// <summary>
///
/// </summary>
- public class MessageBus : INewMessageBus
+ public class MessageBus : IMessageBus
{
private readonly ConcurrentDictionary<string, Topic> _topics = new ConcurrentDictionary<string, Topic>();
private readonly Engine _engine;
@@ -4,7 +4,7 @@ namespace SignalR
{
public static class MessageBusExtensions
{
- public static Task Publish(this INewMessageBus bus, string source, string key, string value)
+ public static Task Publish(this IMessageBus bus, string source, string key, string value)
{
return bus.Publish(new Message(source, key, value));
}
@@ -14,7 +14,7 @@ public abstract class PersistentConnection
{
private const string WebSocketsTransportName = "webSockets";
- protected INewMessageBus _newMessageBus;
+ protected IMessageBus _newMessageBus;
protected IJsonSerializer _jsonSerializer;
protected IConnectionIdGenerator _connectionIdGenerator;
private ITransportManager _transportManager;
@@ -31,7 +31,7 @@ public virtual void Initialize(IDependencyResolver resolver)
return;
}
- _newMessageBus = resolver.Resolve<INewMessageBus>();
+ _newMessageBus = resolver.Resolve<IMessageBus>();
_connectionIdGenerator = resolver.Resolve<IConnectionIdGenerator>();
_jsonSerializer = resolver.Resolve<IJsonSerializer>();
_transportManager = resolver.Resolve<ITransportManager>();
@@ -95,7 +95,7 @@
<Compile Include="Infrastructure\ServerIdManager.cs" />
<Compile Include="IPersistentConnectionContext.cs" />
<Compile Include="Infrastructure\IServerCommandHandler.cs" />
- <Compile Include="MessageBus\INewMessageBus.cs" />
+ <Compile Include="MessageBus\IMessageBus.cs" />
<Compile Include="MessageBus\ISubscriber.cs" />
<Compile Include="MessageBus\MessageBus.cs" />
<Compile Include="MessageBus\IIdGenerator.cs" />

0 comments on commit 4416f65

Please sign in to comment.