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

Improving async functions #7823

Closed
vbcodec opened this issue Jan 7, 2016 · 1 comment
Closed

Improving async functions #7823

vbcodec opened this issue Jan 7, 2016 · 1 comment
Labels
Area-Language Design Resolution-Duplicate The described behavior is tracked in another issue

Comments

@vbcodec
Copy link

vbcodec commented Jan 7, 2016

For now async functions are hardcoded to always return Task object. This is enough for most cases, but could be better to be able return Task-derived types or just any type that have specified certain members. These members are obvious now:

  • passing action in constructor
  • property IsCompleted
  • method GetAwaiter

It could be even better to specify another optional method:
SetCallParams (Parameters As Dictionary (Of String, Object).
This method may be used to pass arguments provided to calling async function. Alternativelly there may be another keyword (for example AsyncObj), available only in async fynctions, that specify returned object (now Task).

This improvement could be helpful for implementing custom awaiters.

@vbcodec vbcodec changed the title Improving async function Improving async functions Jan 7, 2016
@ufcpp
Copy link
Contributor

ufcpp commented Jan 7, 2016

dup of #7169

@gafter gafter closed this as completed Jan 7, 2016
@gafter gafter added Resolution-Duplicate The described behavior is tracked in another issue Area-Language Design labels Jan 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Language Design Resolution-Duplicate The described behavior is tracked in another issue
Projects
None yet
Development

No branches or pull requests

3 participants