I just want to start off by saying that it’s very likely that I’m missing something here, whether it’s something in the code or something in the stated goals/design of the Io interface. It’s possible that I’m trying to shoehorn in a use-case that is not intended for the interface to cover, but it feels like this is something it should be capable of handling.
Basically, I want to be able to queue up some work that needs to be done in the background, but I don’t want to have to await or cancel (which the docs states should be equivalent to await with some added behavior) because doing so would “block” my execution until the Future is resolved. What I would like to do here is effectively spawn an async/concurrent unit of work that I can tell the Io to finish executing and then clean it up; that I don’t care about the result of the Future.
An example of this would be handling network connections. I would like to be able to spawn an async/concurrent unit to handle a connection without having to either “block” my execution on an await/cancel call or be forced to leak the any_future. It seems like there should be something that works similar to a std.Thread’s detach function.
My motivation here is to basically use the Evented Io or build my own Io implementation so that I can create “green threads” for handling my network connections rather than full OS threads.
Is this possible with the current Io design? Would the design need to be amended? Am I just trying to force a square peg into a round hole?
Thank you in advance for any advice/answers!