Closed
Description
The example of fcm-rust
usage from docs shows that the one is expected to use futures::future::lazy()
to prepare a future which can then be spawned, however it's hardly possible in a real backend code as the Client
is not Clone
, i.e. each time when the user wants to spawn a notification, the whole hyper::Client
will have to be moved inside the future for just one request.
It does not make sense to clone Client
though as that would probably be too expensive, so if we want to return a "just a future" which makes the job done, it would make sense to wrap the future which the Client
returns into Lazy
inside the implementation.
Metadata
Metadata
Assignees
Labels
No labels