Skip to content

Commit

Permalink
Merge pull request #5 from byerlikaya/disposable
Browse files Browse the repository at this point in the history
IDisposable
  • Loading branch information
byerlikaya authored Jun 28, 2024
2 parents d170dca + 6137745 commit 0ef0576
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@ Task BasicConsumerReceived(object sender, BasicDeliverEventArgs @event)

channel?.BasicAck(@event.DeliveryTag, false);

return Task.CompletedTask;
await Task.Yield();
}
```
2 changes: 1 addition & 1 deletion src/Basic.RabbitMQ/Basic.RabbitMQ.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<Description>.NET Core library that simplifies RabbitMQ usage and works with the Direct Exchange type.</Description>
<PackageId>Basic.RabbitMQ</PackageId>
<Version>2.0.0.1</Version>
<Version>2.0.0.2</Version>
<Product>Basic.RabbitMQ</Product>
<LangVersion>preview</LangVersion>
</PropertyGroup>
Expand Down
3 changes: 1 addition & 2 deletions src/Basic.RabbitMQ/Interfaces/IMessageConsumer.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
namespace Basic.RabbitMQ.Interfaces;

public interface IMessageConsumer
public interface IMessageConsumer : IDisposable
{
IModel Channel(string queueName, string routingKey, ushort prefetchCount = 1);

AsyncEventingBasicConsumer GetConsumer(IModel channel);
}
2 changes: 1 addition & 1 deletion src/Basic.RabbitMQ/Interfaces/IMessageProducer.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Basic.RabbitMQ.Interfaces;

public interface IMessageProducer
public interface IMessageProducer : IDisposable
{
void SendMessage(string queueName, string routingKey, string message);
void SendMessage<T>(string queueName, string routingKey, T message);
Expand Down
2 changes: 1 addition & 1 deletion src/Basic.RabbitMQ/MessageConsumer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

public class MessageConsumer(
RabbitMqClientService rabbitMqClientService,
ConnectionFactory connectionFactory) : IMessageConsumer, IDisposable
ConnectionFactory connectionFactory) : IMessageConsumer
{
private IConnection _connection;

Expand Down
2 changes: 1 addition & 1 deletion src/Basic.RabbitMQ/MessageProducer.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace Basic.RabbitMQ;

public class MessageProducer(RabbitMqClientService rabbitMqClientService, ConnectionFactory connectionFactory)
: IMessageProducer, IDisposable
: IMessageProducer
{
private readonly IConnection _connection = connectionFactory.CreateConnection();

Expand Down

0 comments on commit 0ef0576

Please sign in to comment.