public T handleResult(final T value)
                                            throws CollectionAbortedException {
                                        try {
                                            T oldValue = iterator.getCurrentValue();
                                            synchronousQueue.put(new ValueMessage(value));
                                            returnQueue.take();  // wait for permission to continue
                                            return oldValue;
                                        } catch (final InterruptedException e) {
                                            // this thread has been aborted
                                            throw new CollectionAbortedException(e);
                                        }
                                    }
This can be manually called by the calling code to force release of
resources at the earliest opportunity.
jphp-runtime/src/php/runtime/util/generator/ThreadedYieldAdapter.java