I’ve used libaco in the past for coroutines in C. I found zlib a pain to use when using curl scheduled with libuv to fetch data. zlib expects a read loop to extract data, but libuv provides an evented push model. Saving all of the zlib state and building a state machine seemed tedious, but a coroutine made the zlib code look like the standard, blocking loop.
This was just code for my own amusement, and maybe used by a few people, for non-production work. I’d do it again, however, if I needed to.
This was just code for my own amusement, and maybe used by a few people, for non-production work. I’d do it again, however, if I needed to.