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

Draft - Deferred connection evaluation #23

Closed
LeonMatthesKDAB opened this issue Feb 2, 2022 · 1 comment
Closed

Draft - Deferred connection evaluation #23

LeonMatthesKDAB opened this issue Feb 2, 2022 · 1 comment
Labels
enhancement New feature or request question Further information is requested

Comments

@LeonMatthesKDAB
Copy link
Contributor

Having the ability to control when a connection is emitted could be advantageous, especially in a multi-threaded context, where a worker thread might emit a signal, but the slot should be called in an event loop on a GUI thread.

To control when exactly a connection is evaluated, implement a ConnectionEvaluator, similar to the BindingEvaluator, that can control when exactly a slot is called.

Add a function connectDeferred (or similar) that takes a ConnectionEvaluator as the first argument, then takes the same arguments as the normal connect function.
This slot would then queue the actual function to be called in the ConnectionEvaluator. The queued functions in the ConnectionEvaluator could then be called at any time, similar to how evaluateAll works on the BindingEvaluator.
The difference here would be that connections might actually be emitted multiple times between calls to the evaluator, so these calls would then also need to be emitted multiple times.

@LeonMatthesKDAB LeonMatthesKDAB added enhancement New feature or request question Further information is requested labels Apr 1, 2022
@LeonMatthesKDAB
Copy link
Contributor Author

We added experimental support for this in #48 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant