Open antoyo opened 7 years ago
I don't quite understand what you mean. Can you give me a use case what you want to achieve?
The API will surely change in the near future as I start to actually use the lib. Right now the focus was getting the basic functionality done.
Different fiber types are done through instantiating new Runner's with different parameters.
easyfibers as opposed to futures/tokio (as I see it) does not aim to have everything running in fibers. I am very hesitant to do fiber-fiber communication other than the parent-child relationship as it exists now.
My use case is to have some kind of asynchronous queue of messages so that one fiber (or any other code actually) can send messages into this queue and have some other code to execute when this queue is polled later and contains a message.
You create a runner, then call one of the new_ functions to start processing on a fiber. Right now all of them are either tied to a socket or a timer. I can add one that is not tied to any of those. It is purely cooperative multitasking however. A fiber stops being executed when issuing a blocking call like write/read or calls join_main.
On master there is a new_processor now. As far as I can see the basic building blocks are there. Or is there something missing?
I'll test that. Thanks.
Hello. I wonder how to define a custom fiber types, for instance, something similar to futures' mpsc. Is it something we can do with easyfibers now? Or is it planned for later? Thanks.