<commit_before>//
//  Publisher.swift
//  ZamzamCore
//
//  Created by <NAME> on 2021-01-02.
//  Copyright © 2021 Zamzam Inc. All rights reserved.
//

import Combine

public extension Optional where Wrapped: Combine.Publisher {<commit_msg>Add Concurrency Combine sink convenience API<commit_after>//
//  Publisher.swift
//  ZamzamCore
//
//  Created by <NAME> on 2021-01-02.
//  Copyright © 2021 Zamzam Inc. All rights reserved.
//

import Combine

public extension Publisher where Failure == Never {
    /// Attaches a subscriber with closure-based behavior to a publisher that never fails.
    func sink(receiveValue: @escaping ((Self.Output) async throws -> Void)) -> AnyCancellable {
        sink { value in Task { try await receiveValue(value) } }
    }
}

public extension Optional where Wrapped: Combine.Publisher {
{'fraction_non_alphanumeric': 0.1070559610705596, 'fraction_numerical': 0.029197080291970802, 'mean_word_length': 3.2422680412371134, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '6950989', 'n_tokens_mistral': 274, 'n_tokens_neox': 234, 'n_words': 86}