<commit_before>/**
 *  DeferredGet.cpp
 *
 *  Implementation of the DeferredGet call
 *
 *  @author <NAME> <<EMAIL>>
 *  @copyright 2014 Copernica BV
 */

/**
 *  Dependencies
 */
#include "includes.h"

/**
 *  Set up namespace
 */
namespace AMQP {

/**
 *  Report success, a get message succeeded and the message is expected soon
 *  @param  messageCount    Message count
 *  @return Deferred
 */
Deferred *DeferredGet::reportSuccess(uint32_t messageCount) const
{
    // make copies of the callbacks
    auto messageCallback = _messageCallback;
    auto finalizeCallback = _finalizeCallback;
    
    // we now know the name, so we can install the message callback on the channel
    _channel->install("", [messageCallback, finalizeCallback](const Message &message, uint64_t deliveryTag, bool redelivered) {
        
        // call the callbacks<commit_msg>basic.get callbacks only have to be installed for a single message, so we uninstall it right after the message was handled<commit_after>/**
 *  DeferredGet.cpp
 *
 *  Implementation of the DeferredGet call
 *
 *  @author <NAME> <<EMAIL>>
 *  @copyright 2014 Copernica BV
 */

/**
 *  Dependencies
 */
#include "includes.h"

/**
 *  Set up namespace
 */
namespace AMQP {

/**
 *  Report success, a get message succeeded and the message is expected soon
 *  @param  messageCount    Message count
 *  @return Deferred
 */
Deferred *DeferredGet::reportSuccess(uint32_t messageCount) const
{
    // make copies of the callbacks
    auto messageCallback = _messageCallback;
    auto finalizeCallback = _finalizeCallback;
    auto *channel = _channel;
    
    // we now know the name, so we can install the message callback on the channel
    _channel->install("", [channel, messageCallback, finalizeCallback](const Message &message, uint64_t deliveryTag, bool redelivered) {

        // we can remove the callback now from the channel
        channel->uninstall("");
        
        // call the callbacks
{'fraction_non_alphanumeric': 0.0923469387755102, 'fraction_numerical': 0.00816326530612245, 'mean_word_length': 3.300438596491228, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '876364', 'n_tokens_mistral': 567, 'n_tokens_neox': 544, 'n_words': 197}