<commit_before>// You can wait for a promise to resolve using the wait() function

import CBGPromise

class Client {
    func getValue() -> Future<String> {
        let promise = Promise<String>()

        someAsyncCall {
            promise.resolve("Test")
        }

        return promise.future
    }
}

class SimpleExample {
    func main() {
        let client = Client()

        let future = client.getValue()

        future.then { value in
            print(value)
        }

        future.wait()
    }
}<commit_msg>Updated Waiting example for consistency<commit_after>// You can wait for a promise to resolve using the wait() function

import CBGPromise

class Client {
    func getValue() -> Future<String> {
        let promise = Promise<String>()

        someAsyncCall {
            promise.resolve("Test")
        }

        return promise.future
    }
}

class WaitingExample {
    func main() {
        let client = Client()

        let future = client.getValue()

        future.then { value in
            print(value)
        }

        future.wait()
    }
}
{'fraction_non_alphanumeric': 0.09435707678075855, 'fraction_numerical': 0.0, 'mean_word_length': 1.8853333333333333, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '2934042', 'n_tokens_mistral': 293, 'n_tokens_neox': 285, 'n_words': 88}