Are there any good examples of an AsyncSequence powered by a ChannelHandler?

The PostgresNIO example wasn't exactly what I was looking for, so I wrote my own.

It includes a handler with an async next method (this could theoretically confirm to AsyncIterator directly, but that feels a bit off to me).

I then have a simple AsyncIterator which repeatedly calls next on a handler:

@lukasa If this is something that would be interesting to contribute to NIO (and doesn't have any obvious pitfalls I'm missing). I'm not super familiar with the NIO project structure so if someone could point me in the right direction (for instance, where would be a good place for something like this to live), I'd be happy to work up a PR.

2 Likes