-
Notifications
You must be signed in to change notification settings - Fork 62
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
How to connect to a signal with specific argument? #59
Comments
Concerning resource lifetime & promises, the easiest way to do this is to create a shared pointer to your resource and transfer it to the continuations where object lifetime is required. If you need some utility for managing signal-connections, you could also reuse the connection helper that QtPromise uses: In principle this is easy to do, but there are a few things to consider in this case. Cancellation is conceptually a tough problem to solve, so this situation begs the question: What's the alternative for continuing the promise if the Just a guess: You're managing a collections of tasks with unique IDs and you'd like to attach continuations to them by ID. Isn't it possible to keep a record of task-promises by ID, look them up by ID and attach continuations to the matched tasks? Another pattern I sometimes use is sort of a promise-response-pool for request+reply like situations. Say there is a service-instance with a |
@pwuertz Thank you for your advise! Let me introduce my requirement more specific:
|
We can connect to a Qt signal by using
How to implement a promise only resolved when not only the signal emitted but also meet a specific condition?
Would this work? Any elegant solution to handle the
context
deletion (for disconnect the lambda expression)?The text was updated successfully, but these errors were encountered: