2013/6/30 Yang Acer <yangacer@gmail.com>On 2013/6/30, at 4:32, "LeMay.Steve" <Steve.Lemay@IGT.com> wrote:Can anyone point me to a modern example or description of using Asio with Spirit to parse and asynchronous stream. I keep finding articles that say this can't be done, or at least not easily (but the comments date back to 2007).SGL_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-usersYou can try coroutine. Here is an example of how to integrate coroutine with asio:I don't know how spirit works internaly - the example above could be useful if spirit reads from a stream (usually parsers read patternfrom a continuous stream of characters).The idea is that the stream_buff used by the stream runs in a coroutine and suspends the corutine-context if not enough charactersare available (from socket, in buffer).Another possible solution would be using the async_result feature from boost.asio (1.54) - but this depends how spirit works.
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users