-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from rabbitmq/misc
Consumer handler messages async
- Loading branch information
Showing
23 changed files
with
391 additions
and
286 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,18 @@ | ||
using Amqp.Listener; | ||
|
||
namespace RabbitMQ.AMQP.Client; | ||
|
||
public class ConsumerException(string message) : Exception(message); | ||
public delegate void MessageHandler(IContext context, IMessage message); | ||
public delegate Task MessageHandler(IContext context, IMessage message); | ||
|
||
public interface IConsumer : ILifeCycle | ||
{ | ||
void Pause(); | ||
|
||
void Unpause(); | ||
|
||
long UnsettledMessageCount { get; } | ||
} | ||
|
||
public interface IMessageHandler | ||
{ | ||
void Handle(Context context, IMessage message); | ||
} | ||
|
||
public interface IContext | ||
{ | ||
void Accept(); | ||
|
||
void Discard(); | ||
|
||
void Requeue(); | ||
Task AcceptAsync(); | ||
Task DiscardAsync(); | ||
Task RequeueAsync(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.