|
Boost : |
From: Andrzej Krzemienski (akrzemi1_at_[hidden])
Date: 2023-08-18 20:30:49
pt., 18 sie 2023 o 13:42 Klemens Morgenstern <
klemensdavidmorgenstern_at_[hidden]> napisaÅ(a):
> .
>>>
>>
>> I agree with the observation. I mean, the weirdness comes into play when
>> we employ the mechanism for injecting values into the generator. This is
>> why I am asking for any use case that would be served by this feature. My
>> hypothesis is that it is useless. Useless in Python and JS, and now it is
>> copied into Boost.Async. I may be wrong about this. This is why an example
>> of a plausible use case woul help proving me wrong.
>>
>
>
> Well the simplest example would be a statemachine. You push in the
> transition and get the current state back when awaiting it.
>
> Simple of course isnt simple here, because state machines need a certain
> complexity to be useful.
>
I am sorry, maybe my imagination is lacking, but from the description above
I do not see how this would work. The way I understand a state machine, I
would expect that if there is an object representing one, when I pass it a
new event (transition), I would expect it to return the state after the
transition. No?
Is there some example online that you can point me to, so I could better
understand such a use case?
Maybe the "examples" section of Boost.Asynch would benefit from such an
example.
>
>> I wasn't really requesting a lazy generator (but maybe it is useful).
>>
>
> Just fyi: i can add that as a runtime option to the existing generator.
> PR is open.
>
Thanks,
&rzej;
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk