AsyncIterator icon indicating copy to clipboard operation
AsyncIterator copied to clipboard

Giving the option of setting the autoStart for the "from*" functions

Open constraintAutomaton opened this issue 1 year ago • 4 comments
trafficstars

Hi everyone,

I wonder if it would fit the library's design to give functions like fromArray the option to set the autoStart to a user-defined value. If this is the case, I can make a PR for it.

constraintAutomaton avatar Oct 21 '24 08:10 constraintAutomaton

The main reason not to would be due to the planned breaking changes around / removal of autostart discussed in #25, but given that they have been sitting there for such a long time (my fault), I think it is reasonable to add such options.

jeswr avatar Oct 21 '24 08:10 jeswr

Thanks for the reply! I will make a PR this week then.

constraintAutomaton avatar Oct 21 '24 08:10 constraintAutomaton

Can't you just use the ArrayIterator constructor directly?

rubensworks avatar Oct 21 '24 08:10 rubensworks

I did that to fix my issue. However, I feel it should be an option with those functions because it changes the behavior quite a lot, and it can be unexpected that the iterator starts "without intervention". Of course, those functions are pretty simple, so building the iterator by oneself is not difficult. So, maybe it is unnecessary, but I think we can argue that those functions as a whole might not be necessary.

constraintAutomaton avatar Oct 21 '24 09:10 constraintAutomaton