INFORMATION ^

This example shows the usage of Stream::Coroutine.

You can only write to the stream with yielding.

Stream::Sub has the advantage that the stream object can be passed to other functions that in turn can write to the stream, which is not possible with coroutine streams.

On the other hand, Stream::Coroutine is more lightweight than Stream::Sub.

FUNCTIONS ^

_main

Creates a coroutine stream and dumps it.

_coro

This sub is a coroutine that is used as the source of the stream. It just writes the numbers 0 to 9 to the stream.

AUTHOR ^

Jens Rieks <parrot at jensbeimsurfen dot de> is the author and maintainer. Please send patches and suggestions to the Perl 6 Internals mailing list.

COPYRIGHT ^

Copyright (C) 2004, The Perl Foundation.


parrot