Skip to content

Commit

Permalink
fixed 'dotnet.exe' process incomplete quit when shutdown application. (
Browse files Browse the repository at this point in the history
#64 )
  • Loading branch information
yang-xiaodong committed Nov 28, 2017
1 parent 0c73f8d commit b03b485
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/DotNetCore.CAP.RabbitMQ/RabbitMQConsumerClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ internal sealed class RabbitMQConsumerClient : IConsumerClient
private readonly string _queueName;
private readonly RabbitMQOptions _rabbitMQOptions;

private IConnection _connection;
private IModel _channel;
private ulong _deliveryTag;

Expand Down Expand Up @@ -57,6 +58,7 @@ public void Listening(TimeSpan timeout, CancellationToken cancellationToken)
cancellationToken.ThrowIfCancellationRequested();
cancellationToken.WaitHandle.WaitOne(timeout);
}
// ReSharper disable once FunctionNeverReturns
}

public void Commit()
Expand All @@ -72,11 +74,12 @@ public void Reject()
public void Dispose()
{
_channel.Dispose();
_connection.Dispose();
}

private void InitClient()
{
var _connection = _connectionChannelPool.GetConnection();
_connection = _connectionChannelPool.GetConnection();

_channel = _connection.CreateModel();

Expand Down

0 comments on commit b03b485

Please sign in to comment.