Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TKTService: provide a method to move the next iteration ahead? #74

Open
tinchodias opened this issue Apr 19, 2020 · 1 comment
Open

Comments

@tinchodias
Copy link
Contributor

In TKTService, I'd like to have the possibility to trigger one iteration before the delay expires. I tried the following implementation and would like to know your opinion (I'm not strong in concurrency :-/):

TKTService>>
iterateService
	self stepService.
	stepDelay wait

as:

TKTService>>
iterateService
	self stepService.
	iterationSemaphore wait: stepDelay

(where stepDelay is a Duration) and added this method:

TKTService>>
anticipateIteration
	iterationSemaphore signal

Which seems to work. Before, I tried an alternative: don't touch TKTService at all but anticipate the Delay with:

Delay>>
anticipate
	"Produce the same effect as if the delay (currently in progress) finished now."
	self unschedule.
	self delaySemaphore signal

but this looked more fragile... touching private behavior of a Kernel class.

@tinchodias
Copy link
Contributor Author

IMPORTANT: When I wrote previous comment, I was working in an outdated version of TKTService (#72 changed it). I'm sorry! The issue's validity is independent, anyway.

I tried with the up-to-date code to anticipate the iteration with other approach: doing a restart. That resulted in #75.

@tinchodias tinchodias changed the title TKTService: a way "anticipate" iteration? TKTService: provide a method to move the next iteration ahead? Apr 21, 2020
tinchodias added a commit to tinchodias/taskit that referenced this issue Apr 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant