#!/usr/bin/env php advance()) { \printf("Producer emitted %d\n", $iterator->getCurrent()); yield new Delayed(100); // Listener consumption takes 100 ms. } } catch (\Exception $exception) { \printf("Exception: %s\n", $exception); } });