<commit_before>use ooc-collections
use ooc-concurrent

PromiseCollector: class {
	_backend : VectorList<Promise>
	count ::= this _backend count
	init: func {
		this _backend = VectorList<Promise> new()
	}
	free: override func {
		this _backend free()
		super()
	}
	add: func (promise: Promise) {
		this _backend add(promise)
	}
	wait: func (haltOnCancel := false) -> Bool {
		status := true
		for (i in 0 .. this _backend count) {
			status = status && this _backend[i] wait()
			if (!status && haltOnCancel)
				break
		}
		status
	}
	wait: func ~timeout (seconds: Double, haltOnCancel := false) -> Bool {
		status := true
		for (i in 0 .. this _backend count) {
			status = status && this _backend[i] wait(seconds)
			if (!status && haltOnCancel)
				break
		}
		status
	}
	cancel: func -> Bool {
		status := true
		for (i in 0 .. this _backend count)
			status = status && this _backend[i] cancel()
		status
	}
	clear: func {
		this _backend clear()
	}
	operator + (promise: Promise) -> This {
		this add(promise)
		this
	}
	operator + (other: This) -> This {
		this _backend append(other _backend)
		this
	}
	operator += (element: Promise) {
		this add(element)
	}
	operator += (other: This) {
		this _backend append(other _backend)
	}
}<commit_msg>Formatted operators in source/concurrent<commit_after>use ooc-collections
use ooc-concurrent

PromiseCollector: class {
	_backend : VectorList<Promise>
	count ::= this _backend count
	init: func {
		this _backend = VectorList<Promise> new()
	}
	free: override func {
		this _backend free()
		super()
	}
	add: func (promise: Promise) {
		this _backend add(promise)
	}
	wait: func (haltOnCancel := false) -> Bool {
		status := true
		for (i in 0 .. this _backend count) {
			status = status && this _backend[i] wait()
			if (!status && haltOnCancel)
				break
		}
		status
	}
	wait: func ~timeout (seconds: Double, haltOnCancel := false) -> Bool {
		status := true
		for (i in 0 .. this _backend count) {
			status = status && this _backend[i] wait(seconds)
			if (!status && haltOnCancel)
				break
		}
		status
	}
	cancel: func -> Bool {
		status := true
		for (i in 0 .. this _backend count)
			status = status && this _backend[i] cancel()
		status
	}
	clear: func {
		this _backend clear()
	}

	operator + (other: This) -> This {
		this _backend append(other _backend)
		this
	}
	operator += (other: This) {
		this _backend append(other _backend)
	}
	operator + (promise: Promise) -> This {
		this add(promise)
		this
	}
	operator += (element: Promise) {
		this add(element)
	}
}
{'fraction_non_alphanumeric': 0.12588792423046566, 'fraction_numerical': 0.0023677979479084454, 'mean_word_length': 3.2676767676767677, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 17, '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': '5511190', 'n_tokens_mistral': 950, 'n_tokens_neox': 859, 'n_words': 271}