mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-07-22 22:20:43 -04:00
concurrency work in prep for speeding things up
refactor splash screen to process initialization in a better way more async tools for async cubit constructors greatly improved StateMapFollower class
This commit is contained in:
parent
8da1dc7d32
commit
9bb20f4dd2
47 changed files with 886 additions and 579 deletions
|
@ -8,34 +8,38 @@ import 'app.dart';
|
|||
import 'tools/tools.dart';
|
||||
import 'veilid_processor/veilid_processor.dart';
|
||||
|
||||
final Completer<void> eventualInitialized = Completer<void>();
|
||||
class VeilidChatGlobalInit {
|
||||
VeilidChatGlobalInit._();
|
||||
|
||||
// Initialize Veilid
|
||||
Future<void> initializeVeilid() async {
|
||||
// Init Veilid
|
||||
Veilid.instance.initializeVeilidCore(
|
||||
getDefaultVeilidPlatformConfig(kIsWeb, VeilidChatApp.name));
|
||||
// Initialize Veilid
|
||||
Future<void> _initializeVeilid() async {
|
||||
// Init Veilid
|
||||
Veilid.instance.initializeVeilidCore(
|
||||
getDefaultVeilidPlatformConfig(kIsWeb, VeilidChatApp.name));
|
||||
|
||||
// Veilid logging
|
||||
initVeilidLog(kDebugMode);
|
||||
// Veilid logging
|
||||
initVeilidLog(kDebugMode);
|
||||
|
||||
// Startup Veilid
|
||||
await ProcessorRepository.instance.startup();
|
||||
// Startup Veilid
|
||||
await ProcessorRepository.instance.startup();
|
||||
|
||||
// DHT Record Pool
|
||||
await DHTRecordPool.init();
|
||||
}
|
||||
// DHT Record Pool
|
||||
await DHTRecordPool.init();
|
||||
}
|
||||
|
||||
// Initialize repositories
|
||||
Future<void> initializeRepositories() async {
|
||||
await AccountRepository.instance.init();
|
||||
}
|
||||
Future<void> _initializeRepositories() async {
|
||||
await AccountRepository.instance.init();
|
||||
}
|
||||
|
||||
Future<void> initializeVeilidChat() async {
|
||||
log.info('Initializing Veilid');
|
||||
await initializeVeilid();
|
||||
log.info('Initializing Repositories');
|
||||
await initializeRepositories();
|
||||
static Future<VeilidChatGlobalInit> initialize() async {
|
||||
final veilidChatGlobalInit = VeilidChatGlobalInit._();
|
||||
|
||||
eventualInitialized.complete();
|
||||
log.info('Initializing Veilid');
|
||||
await veilidChatGlobalInit._initializeVeilid();
|
||||
log.info('Initializing Repositories');
|
||||
await veilidChatGlobalInit._initializeRepositories();
|
||||
|
||||
return veilidChatGlobalInit;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue