- From: Jake Archibald <notifications@github.com>
- Date: Wed, 22 Aug 2018 04:08:29 -0700
- To: heycam/webidl <webidl@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Wednesday, 22 August 2018 11:08:52 UTC
@mkruisselbrink I'm not sure I understand, so this reply may be trash 😀
> if you want to define a method returning an async iterable you'd have to define a separate interface for that return type, and return that instead? Or would `async_iterable<Something>` also be a valid return type directly?
You'd have to define `Something`, or use an existing type. This isn't a return type, it's more like how iterators are currently defined:
```webidl
interface interface_identifier {
iterable<value_type>;
};
```
But the prose associated with `iterable` is pretty basic, and I think you'd struggle to write something like fibonacci counter with it (not that it's been a problem as far as I know).
Async iterables are complicated straight away as you need to deal with "in parallel" and task queueing, else there's no point in it being async, so you really need to a way to express how the values are "pulled".
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/580#issuecomment-414996252
Received on Wednesday, 22 August 2018 11:08:52 UTC