<commit_before>#include <string>
#include <iostream>
#include "cppa/cppa.hpp"

using namespace cppa;

void mirror() {
    // wait for messages
    become (
        // invoke this lambda expression if we receive a string
        on_arg_match >> [](const std::string& what) {
            // prints "Hello World!" via aout (thread-safe wrapper for cout)
            aout << what << std::endl;
            // replies "!dlroW olleH"
            reply(std::string(what.rbegin(), what.rend()));
            // terminates this actor
            self->quit();
        }
    );
}

void hello_world(const actor_ptr& buddy) {
    // send "Hello World!" to our buddy
    send(buddy, "Hello World!");
    // wait for messages
    become (
        on_arg_match >> [](const std::string& what) {
            // prints "!dlroW olleH"
            aout << what << std::endl;
            // terminate this actor
            self->quit();
        }
    );
}

int main() {
    // create a new actor that calls 'mirror()'
    auto mirror_actor = spawn(mirror);
    // create another actor that calls 'hello_world(mirror_actor)'
    spawn(hello_world, mirror_actor);
    // wait until all other actors we have spawned are done
    await_all_others_done();
    // run cleanup code before exiting main
    shutdown();
}<commit_msg>use sync_send in hello world example<commit_after>#include <string>
#include <iostream>
#include "cppa/cppa.hpp"

using namespace cppa;

void mirror() {
    // wait for messages
    become (
        // invoke this lambda expression if we receive a string
        on_arg_match >> [](const std::string& what) {
            // prints "Hello World!" via aout (thread-safe cout wrapper)
            aout << what << std::endl;
            // replies "!dlroW olleH"
            reply(std::string(what.rbegin(), what.rend()));
            // terminates this actor (become otherwise 'loops' forever)
            self->quit();
        }
    );
}

void hello_world(const actor_ptr& buddy) {
    // send "Hello World!" to our buddy ...
    sync_send(buddy, "Hello World!").then(
        // ... and wait for a response
        on_arg_match >> [](const std::string& what) {
            // prints "!dlroW olleH"
            aout << what << std::endl;
        }
    );
}

int main() {
    // create a new actor that calls 'mirror()'
    auto mirror_actor = spawn(mirror);
    // create another actor that calls 'hello_world(mirror_actor)'
    spawn(hello_world, mirror_actor);
    // wait until all other actors we have spawned are done
    await_all_others_done();
    // run cleanup code before exiting main
    shutdown();
}
{'fraction_non_alphanumeric': 0.1265774378585086, 'fraction_numerical': 0.0, 'mean_word_length': 2.22962962962963, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 18, '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': '6310152', 'n_tokens_mistral': 777, 'n_tokens_neox': 769, 'n_words': 241}