pub trait OnGleanEvents: Send {
    fn initialize_finished(&self);
    fn trigger_upload(&self) -> Result<(), CallbackError>;
    fn start_metrics_ping_scheduler(&self) -> bool;
    fn cancel_uploads(&self) -> Result<(), CallbackError>;

    fn shutdown(&self) -> Result<(), CallbackError> { ... }
}
Expand description

A callback object used to trigger actions on the foreign-language side.

A callback object is stored in glean-core for the entire lifetime of the application.

Required Methods§

Initialization finished.

The language SDK can do additional things from within the same initializer thread, e.g. starting to observe application events for foreground/background behavior. The observer then needs to call the respective client activity API.

Trigger the uploader whenever a ping was submitted.

This should not block. The uploader needs to asynchronously poll Glean for new pings to upload.

Start the Metrics Ping Scheduler.

Called when upload is disabled and uploads should be stopped

Provided Methods§

Called on shutdown, before glean-core is fully shutdown.

  • This MUST NOT put any new tasks on the dispatcher.
    • New tasks will be ignored.
  • This SHOULD NOT block arbitrarily long.
    • Shutdown waits for a maximum of 30 seconds.

Implementors§