Skip to content

Commit

Permalink
cleaned up after PR running a tool
Browse files Browse the repository at this point in the history
  • Loading branch information
mookid8000 committed May 18, 2016
1 parent 1a6f941 commit 6a1cd41
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 35 deletions.
2 changes: 1 addition & 1 deletion Rebus.CastleWindsor/CastleWindsorContainerAdapter.cs
Expand Up @@ -78,7 +78,7 @@ public void SetBus(IBus bus)
}

/// <summary>
/// Hack to makes sure we dispose the bus instance when the container is disposed
/// containehack to makes sure we dispose the bus instance when the container is disposed
/// </summary>
class InstanceDisposer : IDisposable
{
Expand Down
2 changes: 1 addition & 1 deletion Rebus.MongoDb/Timeouts/MongoDbTimeoutManager.cs
Expand Up @@ -100,7 +100,7 @@ public Timeout(Dictionary<string, string> headers, byte[] body, DateTime dueTime
public ObjectId Id { get; }
public Dictionary<string, string> Headers { get; }
public byte[] Body { get; }
public DateTime DueTimeUtc { get; protected set; }
public DateTime DueTimeUtc { get; }
public DateTime OriginalDueTimeUtc { get; }
}
}
Expand Down
12 changes: 7 additions & 5 deletions Rebus.PostgreSql/Subscriptions/PostgreSqlSubscriptionStorage.cs
Expand Up @@ -5,6 +5,7 @@
using NpgsqlTypes;
using Rebus.Extensions;
using Rebus.Logging;
using Rebus.Messages.Control;
using Rebus.Subscriptions;

namespace Rebus.PostgreSql.Subscriptions
Expand All @@ -19,7 +20,7 @@ public class PostgreSqlSubscriptionStorage : ISubscriptionStorage
readonly PostgresConnectionHelper _connectionHelper;
readonly string _tableName;
readonly ILog _log;

/// <summary>
/// Constructs the subscription storage, storing subscriptions in the specified <paramref name="tableName"/>.
/// If <paramref name="isCentralized"/> is true, subscribing/unsubscribing will be short-circuited by manipulating
Expand Down Expand Up @@ -89,7 +90,7 @@ public async Task<string[]> GetSubscriberAddresses(string topic)

public async Task RegisterSubscriber(string topic, string subscriberAddress)
{
using(var connection = await _connectionHelper.GetConnection())
using (var connection = await _connectionHelper.GetConnection())
using (var command = connection.CreateCommand())
{
command.CommandText =
Expand Down Expand Up @@ -135,8 +136,9 @@ public async Task UnregisterSubscriber(string topic, string subscriberAddress)
}
}

public bool IsCentralized
{
get; }
/// <summary>
/// Gets whether the subscription storage is centralized and thus supports bypassing the usual subscription request
/// </summary>
public bool IsCentralized { get; }
}
}
25 changes: 1 addition & 24 deletions Rebus.Tests/ListLoggerFactory.cs
Expand Up @@ -8,9 +8,9 @@ namespace Rebus.Tests
{
public class ListLoggerFactory : AbstractRebusLoggerFactory, IEnumerable<LogLine>
{
readonly ConcurrentQueue<LogLine> _loggedLines = new ConcurrentQueue<LogLine>();
readonly bool _outputToConsole;
readonly bool _detailed;
readonly ConcurrentQueue<LogLine> _loggedLines = new ConcurrentQueue<LogLine>();

public ListLoggerFactory(bool outputToConsole = false, bool detailed = false)
{
Expand All @@ -22,7 +22,6 @@ public void Clear()
{
LogLine temp;
while (_loggedLines.TryDequeue(out temp)) { }

Console.WriteLine("Cleared the logs");
}

Expand Down Expand Up @@ -114,26 +113,4 @@ static string SafeFormat(string message, object[] objs)
}
}
}

public class LogLine
{
public DateTime Time { get; private set; }
public LogLevel Level { get; }
public Type Type { get; }
public string Text { get; }

public LogLine(LogLevel level, string text, Type type)
{
Time = DateTime.Now;
Level = level;
Text = text;
Type = type;
}

public override string ToString()
{
return
$"{Level} / {Type} / {string.Join(" | ", Text.Split("\r\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries))}";
}
}
}
27 changes: 27 additions & 0 deletions Rebus.Tests/LogLine.cs
@@ -0,0 +1,27 @@
using System;
using Rebus.Logging;

namespace Rebus.Tests
{
public class LogLine
{
public DateTime Time { get; }
public LogLevel Level { get; }
public Type Type { get; }
public string Text { get; }

public LogLine(LogLevel level, string text, Type type)
{
Time = DateTime.Now;
Level = level;
Text = text;
Type = type;
}

public override string ToString()
{
return
$"{Level} / {Type} / {string.Join(" | ", Text.Split("\r\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries))}";
}
}
}
1 change: 1 addition & 0 deletions Rebus.Tests/Rebus.Tests.csproj
Expand Up @@ -139,6 +139,7 @@
<Compile Include="Integration\TestTypeBasedRouting.cs" />
<Compile Include="Integration\TestTypeHeader.cs" />
<Compile Include="LocalAddin.cs" />
<Compile Include="LogLine.cs" />
<Compile Include="Persistence\SqlServer\SqlServerSagaSnapshotStorageTest.cs" />
<Compile Include="Persistence\SqlServer\SqlServerSnapshotStorageFactory.cs" />
<Compile Include="Persistence\SqlServer\SqlServerSubscriptionStorageBasicSubscriptionOperations.cs" />
Expand Down
6 changes: 2 additions & 4 deletions Rebus/Transport/DefaultTransactionContext.cs
Expand Up @@ -34,9 +34,7 @@ public DefaultTransactionContext()
/// <summary>
/// Stash of items that can carry stuff for later use in the transaction
/// </summary>
public ConcurrentDictionary<string, object> Items
{
get; }
public ConcurrentDictionary<string, object> Items { get; }

/// <summary>
/// Registers a listener to be called when the queue transaction is committed. This hook is reserved for the queue transaction
Expand Down Expand Up @@ -164,7 +162,7 @@ static void Invoke(ConcurrentQueue<Action> actions)
while (actions.TryDequeue(out action))
{
action();
}
}
}

static async Task Invoke(ConcurrentQueue<Func<Task>> actions)
Expand Down

0 comments on commit 6a1cd41

Please sign in to comment.