mirror of
https://github.com/qmlnet/qmlnet.git
synced 2026-05-15 14:15:54 -06:00
[GH-ISSUE #21] Support for async/await callbacks with result. #14
Labels
No labels
bug
enhancement
help wanted
help wanted
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/qmlnet#14
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @pauldotknopf on GitHub (Jul 21, 2018).
Original GitHub issue: https://github.com/qmlnet/qmlnet/issues/21
Consider this C# code.
C#
Currently, we support invoking this method and having the continuations happen on the UI thread.
Qml
The problem is that the caller has no way of knowing when this function is completed.
@pauldotknopf commented on GitHub (Jul 21, 2018):
Scenario 1
C#
Qml
Scenario 2
C#
Qml
Scenario 3
C#
Qml
Scenario 4
C#
Qml
Notes
Some things to take away from this is that there will never be any interacting with
Taskobjects as a return type. The async methods will always be transformed in Qml to a method without a return type (void).If any method returns
Task, there will also be a check to see if the last parameter for the method is aCancellationToken. If it is, is will be treated specially by the integration.@pauldotknopf commented on GitHub (Jul 25, 2018):
I'm thinking something a little differently for this now.
Methods that return
Taskwill stay as is. You can always do this from qml (but don't):I am going to add this global
Netobject.Then we can do something like this.