本文整理汇总了C#中IBasicConsumer.HandleBasicConsumeOk方法的典型用法代码示例。如果您正苦于以下问题:C# IBasicConsumer.HandleBasicConsumeOk方法的具体用法?C# IBasicConsumer.HandleBasicConsumeOk怎么用?C# IBasicConsumer.HandleBasicConsumeOk使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IBasicConsumer
的用法示例。
在下文中一共展示了IBasicConsumer.HandleBasicConsumeOk方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleBasicConsumeOk
public void HandleBasicConsumeOk(IBasicConsumer consumer,
string consumerTag)
{
UnlessShuttingDown(() =>
{
try
{
consumer.HandleBasicConsumeOk(consumerTag);
}
catch (Exception e)
{
var details = new Dictionary<string, object>()
{
{"consumer", consumer},
{"context", "HandleBasicConsumeOk"}
};
model.OnCallbackException(CallbackExceptionEventArgs.Build(e, details));
}
});
}
示例2: BasicConsume
public string BasicConsume(string queue, bool noAck, string consumerTag, IBasicConsumer consumer)
{
if (!connection.Queues.ContainsKey(queue))
{
throw new InMemoryClientException(string.Format("Queue '{0}' does not exist", queue));
}
consumer.HandleBasicConsumeOk(consumerTag);
connection.Queues[queue].AddConsumer(noAck, consumerTag, consumer);
return "";
}