I want to use async Rust (Tokio) in a segregated part of an app.
The fn signatures of this module will not be async. Internally, it will make async calls (reqwest). It does not need to do anything with responses other than log them, but I don't want to block the calling thread so I want to return right away.
So, I need to kick-off async functions, operate on the response, but make this transparent to the caller.
(This would, of course, be trivially simple if I could fire & forget a tokio::task with spawn, but something has to process the response.)
Is there a good pattern for such a use-case? I'm thinking there is not. Either fn async has to be viral or else I need some machinery of some sort to handle async responses.
Logging them is the "something." I meant that the caller doesn't care about the response; the fn that makes the request doesn't need to return it. Sorry, was unclear.