<commit_before>﻿# reference "Witness.coffee"
# reference "Event.coffee"
# reference "TimeoutError.coffee"

{ Event, TimeoutError } = @witness

@witness.AsyncAction = class AsyncAction
	
	constructor: (@func, @args = [], @description, @timeout = AsyncAction.defaultTimeout) ->
		@on = Event.define "running", "passed", "failed"

	setTimeout: (timeout) ->
		@timeout = timeout
		return this

	run: (context, done, fail) ->
		@on.running.raise()

		cancelledByTimeout = false
		context.done = (args...)=><commit_msg>Rename AsyncAction setTimeout to withTimeout.<commit_after>﻿# reference "Witness.coffee"
# reference "Event.coffee"
# reference "TimeoutError.coffee"

{ Event, TimeoutError } = @witness

@witness.AsyncAction = class AsyncAction
	
	constructor: (@func, @args = [], @description, @timeout = AsyncAction.defaultTimeout) ->
		@on = Event.define "running", "passed", "failed"

	withTimeout: (timeout) ->
		@timeout = timeout
		return this

	run: (context, done, fail) ->
		@on.running.raise()

		cancelledByTimeout = false
		context.done = (args...)=>
{'fraction_non_alphanumeric': 0.153918791312559, 'fraction_numerical': 0.0, 'mean_word_length': 4.638297872340425, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '6342182', 'n_tokens_mistral': 362, 'n_tokens_neox': 329, 'n_words': 81}