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

Add a timeout option for force #21

Open
tmccombs opened this issue Feb 15, 2016 · 3 comments
Open

Add a timeout option for force #21

tmccombs opened this issue Feb 15, 2016 · 3 comments

Comments

@tmccombs
Copy link

It would be nice to have a way for force to timeout while waiting for a promise to be fulfilled.

@lmj
Copy link
Owner

lmj commented Feb 26, 2016

Yes I had been thinking about try-force -- it's not in yet because the timeout option in bordeaux-threads is relatively recent and lparallel doesn't yet require it. Since futures can return multiple values, try-force may be a bit cumbersome, though, like (multiple-value-bind (vals success) (try-force f) ...).

@lmj
Copy link
Owner

lmj commented Feb 27, 2016

This requires an additional slot for a condition variable in the future struct, which may be another reason that I avoided it. As with queues the cvar would be lazily created, but futures would be a little heavier nonetheless. Benchmarks probably won't be affected where waiting with timeout is never done.

@tmccombs
Copy link
Author

One to deal with muliple values could be to signal a condition on a timeout, but that would be more cumbersome for the user to handle, and would be inconsistent with the timeout behavior for queues.

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

No branches or pull requests

2 participants