<commit_before>Class {
	#name : #BlDevScripterWaitStep,
	#superclass : #BlDevScripterInteractionStep,
	#instVars : [
		'waitingBlock'
	],
	#category : #'Bloc-DevTool-Scripter-Steps'
}

{ #category : #initialization }
BlDevScripterWaitStep >> defaultLabel [
	^ 'Wait'
]

{ #category : #initialization }
BlDevScripterWaitStep >> forEmptySpaceTaskQueue [
	self label: 'Wait For Empty Task Queue'.
	self onSpace.
	self waitingBlock: [ :aSpace |
		aSpace time 
			every: 20 milliSeconds 
			while: [ aSpace taskQueue tasks isNotEmpty ] 
			do: [ aSpace pulse ] ]
]

{ #category : #initialization }
BlDevScripterWaitStep >> forEmptySpaceTaskQueueTimeout: aDuration [
	self label: ('Wait For Empty Task Queue with {1} timeout' format: { aDuration }).
	self onSpace.
	self waitingBlock: [ :aSpace |
		| aStartTime |
		aStartTime := aSpace time now.		
		aSpace time 
			every: 100 milliSeconds 
			while: [ (aSpace time now < (aStartTime + aDuration)) and: [ aSpace taskQueue tasks isNotEmpty ] ] 
			do: [ aSpace pulse ] ]
]

{ #category : #actions }<commit_msg>[feenkcom/gtoolkit#1664] scripter should pulse space at least once when waiting for the empty task queue<commit_after>Class {
	#name : #BlDevScripterWaitStep,
	#superclass : #BlDevScripterInteractionStep,
	#instVars : [
		'waitingBlock'
	],
	#category : #'Bloc-DevTool-Scripter-Steps'
}

{ #category : #initialization }
BlDevScripterWaitStep >> defaultLabel [
	^ 'Wait'
]

{ #category : #initialization }
BlDevScripterWaitStep >> forEmptySpaceTaskQueue [
	self label: 'Wait For Empty Task Queue'.
	self onSpace.
	self waitingBlock: [ :aSpace |
		aSpace pulse.
		aSpace time 
			every: 20 milliSeconds 
			while: [ aSpace taskQueue tasks isNotEmpty ] 
			do: [ aSpace pulse ] ]
]

{ #category : #initialization }
BlDevScripterWaitStep >> forEmptySpaceTaskQueueTimeout: aDuration [
	self label: ('Wait For Empty Task Queue with {1} timeout' format: { aDuration }).
	self onSpace.
	self waitingBlock: [ :aSpace |
		| aStartTime |
		aStartTime := aSpace time now.		
		aSpace time 
			every: 100 milliSeconds 
			while: [ (aSpace time now < (aStartTime + aDuration)) and: [ aSpace taskQueue tasks isNotEmpty ] ] 
			do: [ aSpace pulse ] ]
]

{ #category : #actions }
{'fraction_non_alphanumeric': 0.10970654627539503, 'fraction_numerical': 0.007223476297968397, 'mean_word_length': 4.1896955503512885, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '4547424', 'n_tokens_mistral': 828, 'n_tokens_neox': 763, 'n_words': 198}