-
Notifications
You must be signed in to change notification settings - Fork 10
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
Cannot rewind a generator that was already run #6
Comments
Hey @arnedesmedt , thx for reporting the bug. It's my fault. I've tried to fix an issue with the MapIterator of the php-engine-utils package. We recognized a problem when using the MapIterator with a MongoDB cursor, so I've refactored it to use a Generator internally. Unfortunately, I've forgotten that Generators are not rewindable :( In our current project we use Event Engine with a custom MongoDB store (not open source yet) and the fix worked for us but I did not test it with prooph v7 PDO Event Store :( FixRun Can you try again with the new version? Sorry for the problems. I already discussed with @sandrokeil that we will write a test suite that goes through the tutorial and ensures it's working when we release a new version of a package. |
Thank you very much for the fix. It works now! |
great! Hopefully you can enjoy the rest of the tutorial without strange bugs ;) |
Hi,
Thx for the new event machine v2!
I was implementing the event engine tutorial (https://event-engine.io/tutorial/) but I'm stuck on an exception thrown in the postgresql event store: It throws 'Cannot rewind a generator that was already run': https://github.com/prooph/pdo-event-store/blob/master/src/PostgresEventStore.php#L194-L200
The error is thrown at line 200. But the problem is that the iterator (here the Generator) is looped in the prepareData function and rewinded in the \iterator_count function. And that throws the exception. See https://www.php.net/manual/en/generator.rewind.php
Is there a workaround for preventing this error?
Thx in advance,
Arne
The text was updated successfully, but these errors were encountered: