Skip to content

Commit

Permalink
Merge pull request #89 from dotnetcore/dev
Browse files Browse the repository at this point in the history
v0.5.3 release
  • Loading branch information
catcherwong authored Mar 2, 2019
2 parents a45b140 + c92d78f commit dd3732b
Show file tree
Hide file tree
Showing 30 changed files with 2,463 additions and 892 deletions.
25 changes: 13 additions & 12 deletions build/releasenotes.props
Original file line number Diff line number Diff line change
@@ -1,43 +1,44 @@
<Project>
<PropertyGroup>
<EasyCachingCorePackageNotes>
1. Fixed ReturnValue bugs of Interceptors
1. Support diagnostics.
2. Interceptor should generate valid cache key for basic type parameters
</EasyCachingCorePackageNotes>
<EasyCachingMemcachedPackageNotes>
1. Fixed ReturnValue bugs of Interceptors
1. Update EasyCaching.Core.
</EasyCachingMemcachedPackageNotes>
<EasyCachingRedisPackageNotes>
1. Fixed ReturnValue bugs of Interceptors
1. Update EasyCaching.Core.
</EasyCachingRedisPackageNotes>
<EasyCachingSQLitePackageNotes>
1. Fixed ReturnValue bugs of Interceptors
1. Update EasyCaching.Core.
</EasyCachingSQLitePackageNotes>
<EasyCachingInMemoryPackageNotes>
1. Fixed ReturnValue bugs of Interceptors
1. Update EasyCaching.Core.
</EasyCachingInMemoryPackageNotes>
<EasyCachingHybridPackageNotes>
1. Fixed ReturnValue bugs of Interceptors
1. Update EasyCaching.Core.
</EasyCachingHybridPackageNotes>
<EasyCachingAspectCorePackageNotes>
1. Fixed ReturnValue bugs of Interceptors
1. Update EasyCaching.Core.
</EasyCachingAspectCorePackageNotes>
<EasyCachingCastlePackageNotes>
1. Fixed ReturnValue bugs of Interceptors
1. Update EasyCaching.Core.
</EasyCachingCastlePackageNotes>
<EasyCachingResponseCachingPackageNotes>
1. Update EasyCaching.Core.
</EasyCachingResponseCachingPackageNotes>
<EasyCachingJsonPackageNotes>
1. Fixed ReturnValue bugs of Interceptors
1. Update EasyCaching.Core.
</EasyCachingJsonPackageNotes>
<EasyCachingMessagePackPackageNotes>
1. Fixed ReturnValue bugs of Interceptors
1. Update EasyCaching.Core.
</EasyCachingMessagePackPackageNotes>
<EasyCachingProtobufPackageNotes>
1. Fixed ReturnValue bugs of Interceptors
1. Update EasyCaching.Core.
</EasyCachingProtobufPackageNotes>
<EasyCachingCSRedisPackageNotes>
1. Fixed ReturnValue bugs of Interceptors
1. Update EasyCaching.Core.
</EasyCachingCSRedisPackageNotes>
<EasyCachingRedisBusPackageNotes>
1. Update EasyCaching.Core.
Expand Down
32 changes: 16 additions & 16 deletions build/version.props
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<Project>
<PropertyGroup>
<EasyCachingCorePackageVersion>0.5.2</EasyCachingCorePackageVersion>
<EasyCachingMemcachedPackageVersion>0.5.2</EasyCachingMemcachedPackageVersion>
<EasyCachingRedisPackageVersion>0.5.2</EasyCachingRedisPackageVersion>
<EasyCachingSQLitePackageVersion>0.5.2</EasyCachingSQLitePackageVersion>
<EasyCachingInMemoryPackageVersion>0.5.2</EasyCachingInMemoryPackageVersion>
<EasyCachingHybridPackageVersion>0.5.2</EasyCachingHybridPackageVersion>
<EasyCachingAspectCorePackageVersion>0.5.2.1</EasyCachingAspectCorePackageVersion>
<EasyCachingCastlePackageVersion>0.5.2.1</EasyCachingCastlePackageVersion>
<EasyCachingResponseCachingPackageVersion>0.5.2</EasyCachingResponseCachingPackageVersion>
<EasyCachingJsonPackageVersion>0.5.2</EasyCachingJsonPackageVersion>
<EasyCachingMessagePackPackageVersion>0.5.2</EasyCachingMessagePackPackageVersion>
<EasyCachingProtobufPackageVersion>0.5.2</EasyCachingProtobufPackageVersion>
<EasyCachingCSRedisPackageVersion>0.5.2</EasyCachingCSRedisPackageVersion>
<EasyCachingRedisBusPackageVersion>0.5.2</EasyCachingRedisBusPackageVersion>
<EasyCachingCSRedisBusPackageVersion>0.5.2</EasyCachingCSRedisBusPackageVersion>
<EasyCachingRabbitBusPackageVersion>0.5.2</EasyCachingRabbitBusPackageVersion>
<EasyCachingCorePackageVersion>0.5.3</EasyCachingCorePackageVersion>
<EasyCachingMemcachedPackageVersion>0.5.3</EasyCachingMemcachedPackageVersion>
<EasyCachingRedisPackageVersion>0.5.3</EasyCachingRedisPackageVersion>
<EasyCachingSQLitePackageVersion>0.5.3</EasyCachingSQLitePackageVersion>
<EasyCachingInMemoryPackageVersion>0.5.3</EasyCachingInMemoryPackageVersion>
<EasyCachingHybridPackageVersion>0.5.3</EasyCachingHybridPackageVersion>
<EasyCachingAspectCorePackageVersion>0.5.3</EasyCachingAspectCorePackageVersion>
<EasyCachingCastlePackageVersion>0.5.3</EasyCachingCastlePackageVersion>
<EasyCachingResponseCachingPackageVersion>0.5.3</EasyCachingResponseCachingPackageVersion>
<EasyCachingJsonPackageVersion>0.5.3</EasyCachingJsonPackageVersion>
<EasyCachingMessagePackPackageVersion>0.5.3</EasyCachingMessagePackPackageVersion>
<EasyCachingProtobufPackageVersion>0.5.3</EasyCachingProtobufPackageVersion>
<EasyCachingCSRedisPackageVersion>0.5.3</EasyCachingCSRedisPackageVersion>
<EasyCachingRedisBusPackageVersion>0.5.3</EasyCachingRedisBusPackageVersion>
<EasyCachingCSRedisBusPackageVersion>0.5.3</EasyCachingCSRedisBusPackageVersion>
<EasyCachingRabbitBusPackageVersion>0.5.3</EasyCachingRabbitBusPackageVersion>
</PropertyGroup>
</Project>
18 changes: 6 additions & 12 deletions src/EasyCaching.Bus.CSRedis/DefaultCSRedisBus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,17 @@
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using EasyCaching.Core;
using EasyCaching.Core.Bus;
using Newtonsoft.Json;

public class DefaultCSRedisBus : IEasyCachingBus
public class DefaultCSRedisBus : EasyCachingAbstractBus
{
/// <summary>
/// The cache.
/// </summary>
private readonly EasyCachingCSRedisClient _client;

/// <summary>
/// The handler.
/// </summary>
private Action<EasyCachingMessage> _handler;

/// <summary>
/// Initializes a new instance of the <see cref="T:EasyCaching.Bus.CSRedis.DefaultCSRedisBus"/> class.
/// </summary>
Expand All @@ -34,7 +30,7 @@ public DefaultCSRedisBus(IEnumerable<EasyCachingCSRedisClient> clients)
/// </summary>
/// <param name="topic">Topic.</param>
/// <param name="message">Message.</param>
public void Publish(string topic, EasyCachingMessage message)
public override void BasePublish(string topic, EasyCachingMessage message)
{
var msg = JsonConvert.SerializeObject(message);

Expand All @@ -48,7 +44,7 @@ public void Publish(string topic, EasyCachingMessage message)
/// <param name="topic">Topic.</param>
/// <param name="message">Message.</param>
/// <param name="cancellationToken">Cancellation token.</param>
public async Task PublishAsync(string topic, EasyCachingMessage message, CancellationToken cancellationToken = default(CancellationToken))
public override async Task BasePublishAsync(string topic, EasyCachingMessage message, CancellationToken cancellationToken = default(CancellationToken))
{
var msg = JsonConvert.SerializeObject(message);

Expand All @@ -60,10 +56,8 @@ public void Publish(string topic, EasyCachingMessage message)
/// </summary>
/// <param name="topic">Topic.</param>
/// <param name="action">Action.</param>
public void Subscribe(string topic, Action<EasyCachingMessage> action)
public override void BaseSubscribe(string topic, Action<EasyCachingMessage> action)
{
_handler = action;

_client.Subscribe(
(topic, msg => OnMessage(msg.Body))
);
Expand All @@ -77,7 +71,7 @@ private void OnMessage(string body)
{
var message = JsonConvert.DeserializeObject<EasyCachingMessage>(body);

_handler?.Invoke(message);
BaseOnMessage(message);
}
}
}
17 changes: 6 additions & 11 deletions src/EasyCaching.Bus.RabbitMQ/DefaultRabbitMQBus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System;
using System.Threading;
using System.Threading.Tasks;
using EasyCaching.Core;
using EasyCaching.Core.Bus;
using EasyCaching.Core.Serialization;
using global::RabbitMQ.Client;
Expand All @@ -13,7 +14,7 @@
/// <summary>
/// Default RabbitMQ Bus.
/// </summary>
public class DefaultRabbitMQBus : IEasyCachingBus
public class DefaultRabbitMQBus : EasyCachingAbstractBus
{
/// <summary>
/// The subscriber connection.
Expand All @@ -25,11 +26,6 @@ public class DefaultRabbitMQBus : IEasyCachingBus
/// </summary>
private readonly ObjectPool<IConnection> _pubConnectionPool;

/// <summary>
/// The handler.
/// </summary>
private Action<EasyCachingMessage> _handler;

/// <summary>
/// The rabbitMQ Bus options.
/// </summary>
Expand Down Expand Up @@ -83,7 +79,7 @@ IPooledObjectPolicy<IConnection> _objectPolicy
/// </summary>
/// <param name="topic">Topic.</param>
/// <param name="message">Message.</param>
public void Publish(string topic, EasyCachingMessage message)
public override void BasePublish(string topic, EasyCachingMessage message)
{
var conn = _pubConnectionPool.Get();

Expand Down Expand Up @@ -112,7 +108,7 @@ public void Publish(string topic, EasyCachingMessage message)
/// <param name="topic">Topic.</param>
/// <param name="message">Message.</param>
/// <param name="cancellationToken">Cancellation token.</param>
public Task PublishAsync(string topic, EasyCachingMessage message, CancellationToken cancellationToken = default(CancellationToken))
public override Task BasePublishAsync(string topic, EasyCachingMessage message, CancellationToken cancellationToken = default(CancellationToken))
{
var conn = _pubConnectionPool.Get();
try
Expand All @@ -139,9 +135,8 @@ public void Publish(string topic, EasyCachingMessage message)
/// </summary>
/// <param name="topic">Topic.</param>
/// <param name="action">Action.</param>
public void Subscribe(string topic, Action<EasyCachingMessage> action)
public override void BaseSubscribe(string topic, Action<EasyCachingMessage> action)
{
_handler = action;
var queueName = string.Empty;
if (string.IsNullOrWhiteSpace(_options.QueueName))
{
Expand Down Expand Up @@ -187,7 +182,7 @@ private void OnMessage(object sender, BasicDeliverEventArgs e)
{
var message = _serializer.Deserialize<EasyCachingMessage>(e.Body);

_handler?.Invoke(message);
BaseOnMessage(message);
}
}
}
16 changes: 5 additions & 11 deletions src/EasyCaching.Bus.Redis/DefaultRedisBus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/// <summary>
/// Default redis bus.
/// </summary>
public class DefaultRedisBus : IEasyCachingBus
public class DefaultRedisBus : EasyCachingAbstractBus
{
/// <summary>
/// The subscriber.
Expand All @@ -23,11 +23,6 @@ public class DefaultRedisBus : IEasyCachingBus
/// </summary>
private readonly IRedisSubscriberProvider _subscriberProvider;

/// <summary>
/// The handler.
/// </summary>
private Action<EasyCachingMessage> _handler;

/// <summary>
/// The serializer.
/// </summary>
Expand Down Expand Up @@ -56,15 +51,15 @@ private void OnMessage(RedisChannel channel, RedisValue value)
{
var message = _serializer.Deserialize<EasyCachingMessage>(value);

_handler?.Invoke(message);
BaseOnMessage(message);
}

/// <summary>
/// Publish the specified topic and message.
/// </summary>
/// <param name="topic">Topic.</param>
/// <param name="message">Message.</param>
public void Publish(string topic, EasyCachingMessage message)
public override void BasePublish(string topic, EasyCachingMessage message)
{
ArgumentCheck.NotNullOrWhiteSpace(topic, nameof(topic));

Expand All @@ -78,7 +73,7 @@ public void Publish(string topic, EasyCachingMessage message)
/// <param name="topic">Topic.</param>
/// <param name="message">Message.</param>
/// <param name="cancellationToken">Cancellation token.</param>
public async Task PublishAsync(string topic, EasyCachingMessage message, CancellationToken cancellationToken = default(CancellationToken))
public override async Task BasePublishAsync(string topic, EasyCachingMessage message, CancellationToken cancellationToken = default(CancellationToken))
{
ArgumentCheck.NotNullOrWhiteSpace(topic, nameof(topic));

Expand All @@ -90,9 +85,8 @@ public void Publish(string topic, EasyCachingMessage message)
/// </summary>
/// <param name="topic">Topic.</param>
/// <param name="action">Action.</param>
public void Subscribe(string topic, Action<EasyCachingMessage> action)
public override void BaseSubscribe(string topic, Action<EasyCachingMessage> action)
{
_handler = action;
_subscriber.Subscribe(topic, OnMessage);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

public partial class DefaultCSRedisCachingProvider : IRedisCachingProvider
{

public long ZAdd<T>(string cacheKey, Dictionary<T, double> cacheValues)
{
ArgumentCheck.NotNullOrWhiteSpace(cacheKey, nameof(cacheKey));
Expand Down
Loading

0 comments on commit dd3732b

Please sign in to comment.