AppInitializationCallback typedef

AppInitializationCallback = Future<void> Function(ServiceInstance service)

Signature for the application-specific initialization callback.

This function is executed in the background isolate when the service starts. It's responsible for initializing any resources needed by the background tasks, such as database connections (for the background isolate), Supabase client, or Riverpod containers. It must also register all job handlers using BackgroundService.registerJobHandler and set the background database connection using BackgroundService.setBackgroundDbConnection.

The service parameter provides an instance of ServiceInstance for interacting with the background service from within this callback.

Implementation

typedef AppInitializationCallback =
    Future<void> Function(ServiceInstance service);