jeikabu / runng

MIT License
25 stars 3 forks source link

Long running Aio #67

Closed janjaapbos closed 2 years ago

janjaapbos commented 2 years ago

Is it possible to create a long running Aio reusing the same callback, to be used for workers, like in the example for nng-rs? See https://github.com/neachdainn/nng-rs/blob/master/examples/async.rs

My understanding of runng leads me to believe that Aio's are one time use only, and cannot be rescheduled to do another receive. Is that correct, or is there a way?

janjaapbos commented 2 years ago

To clarify, I am researching how to create a pool of workers with runng, and also looked at ThreadPool of the futures crate.

janjaapbos commented 2 years ago

Actually, I just found out that I can reuse the same ReplyAsyncHandle in a loop, receiving and replying. So that solves my question.