On 05/20/2016 12:56 PM, Yuxuan Shui wrote:
> On Friday, 20 May 2016 at 06:40:42 UTC, Jacob Carlborg wrote:
>> On 2016-05-20 04:14, Yuxuan Shui wrote:
>>
>>> Hmm... This could work. But I'm not satisfied with this solution. What
>>> if I have multiple yield sites in the fiber, and each have differe
On Friday, 20 May 2016 at 06:40:42 UTC, Jacob Carlborg wrote:
On 2016-05-20 04:14, Yuxuan Shui wrote:
Hmm... This could work. But I'm not satisfied with this
solution. What
if I have multiple yield sites in the fiber, and each have
different
return types?
Maybe I should use a Variant?
I th
On 2016-05-20 04:14, Yuxuan Shui wrote:
Hmm... This could work. But I'm not satisfied with this solution. What
if I have multiple yield sites in the fiber, and each have different
return types?
Maybe I should use a Variant?
I think you can view "yield" as a form of "return". If you cannot ret
On Thursday, 19 May 2016 at 23:42:03 UTC, Ali Çehreli wrote:
On 05/19/2016 12:57 PM, Yuxuan Shui wrote:
[...]
You can use a delegate that takes a ref parameter:
import std.stdio;
import core.thread;
void fiberFunc(ref string y) {
y = "produced_by_fiberFunc";
Fiber.yield();
}
void ma
On 05/19/2016 04:42 PM, Ali Çehreli wrote:
> You can use a delegate that takes a ref parameter:
Correction: You can use a delegate that calls a function that takes a
ref parameter.
Ali
On 05/19/2016 12:57 PM, Yuxuan Shui wrote:
I find this difficult because I can't passing data via
Fiber.yield/Fiber.call pair. e.g. I want something like:
void fiberFunc() {
//Add some file descriptor to main loop
string y = Fiber.yield();
writeln(y);
}
auto f = new Fiber(&fiberFunc
I find this difficult because I can't passing data via
Fiber.yield/Fiber.call pair. e.g. I want something like:
void fiberFunc() {
//Add some file descriptor to main loop
string y = Fiber.yield();
writeln(y);
}
auto f = new Fiber(&fiberFunc);
f.call();
mainloop {
if (fd_readable)