Names:

Concepts:

Streams are unidirectional. There's two streams for a TCP connection.

Ryu::Async::TCP::Client Ryu::Async::TCP::Server Ryu::Async::TCP

Ryu::Source

A source emits a stream of events.

A byte stream can be adapted to a char stream.

my $cs = Ryu::Source::Chars->from($bs, as => 'UTF-8');

Byte streams are intended for dealing with protocols.

$src->packed(C1 => sub {
 my ($type) = @_;
});

There's also some common stream facilities:

$src->gather(4 => sub {
 my $items = shift; # arrayref
});

Ryu::Sink

Sinks receive events.

Each stream has related streams.

Iterating via ->each:

 $thing->each(sub { $ui->notify($_) })->on_ready(sub { $ui->notify_done })

Attaching the stream:

 $thing->notify($ui)

Components:

UI elements will typically attach their own listeners for all the components. Plain processing may only want ->next and ->done.