<commit_before># Anything that can be subscribed to does this role. It provides the basic
# supply management infrastructure, as well as various coercions that
# turn Supply-like things into something else and convenience forms of calls
# to SupplyOperations.

my class SupplyOperations { ... }
my role Supply {
    my class Tap {
        has &.next;
        has &.last;
        has &.fail;
        has $.supply;
        method untap() {
            $!supply.untap(self)
        }
    }

    has @!tappers;
    has $!tappers_lock = Lock.new;

    method tap(&next, &last?, &fail?) {
        my $sub = Tap.new(:&next, :&last, :&fail, :supply(self));
        $!tappers_lock.protect({
            @!tappers.push($sub);
        });
        $sub
    }

    method untap(Tap $t) {
        $!tappers_lock.protect({<commit_msg>Supply.untap should be Supply.close<commit_after># Anything that can be subscribed to does this role. It provides the basic
# supply management infrastructure, as well as various coercions that
# turn Supply-like things into something else and convenience forms of calls
# to SupplyOperations.

my class SupplyOperations { ... }
my role Supply {
    my class Tap {
        has &.next;
        has &.last;
        has &.fail;
        has $.supply;
        method close() {
            $!supply.close(self)
        }
    }

    has @!tappers;
    has $!tappers_lock = Lock.new;

    method tap(&next, &last?, &fail?) {
        my $sub = Tap.new(:&next, :&last, :&fail, :supply(self));
        $!tappers_lock.protect({
            @!tappers.push($sub);
        });
        $sub
    }

    method close(Tap $t) {
        $!tappers_lock.protect({
{'fraction_non_alphanumeric': 0.12409638554216867, 'fraction_numerical': 0.0, 'mean_word_length': 2.2315175097276265, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7288464', 'n_tokens_mistral': 530, 'n_tokens_neox': 508, 'n_words': 158}