-
Notifications
You must be signed in to change notification settings - Fork 19
Description
Is your feature request related to a problem? Please describe.
Currently, Client provides a flush method that can be used to flush pending analytics events. However, there is no way to await the flush to ensure that analytics events have completed without calling Client::close to completely destroy the client.
For serverless use cases in particular, it would be very helpful to be able to ensure that analytics events have been reported before allowing the (e.g., AWS Lambda) function to suspend and wait for the next request (which might never come, in which case the analytics events would be dropped).
Describe the solution you'd like
Have flush return a Future. A straightforward way to do this is in Rust is via a channel (e.g., futures::channel::oneshot).