-
Notifications
You must be signed in to change notification settings - Fork 0
DataManager
Sammy Aknan edited this page Mar 14, 2025
·
3 revisions
The DataManager has a number of responsibilities and only one instance should exist per application. Simply put, it manages all cached data.
Here's an example on creating a DataManager:
DataSourceConfig dataSourceConfig = new DataSourceConfig(
System.getenv("DATABASE_HOST"),
Integer.parseInt(System.getenv("DATABASE_PORT")),
System.getenv("DATABASE_DATABASE"),
System.getenv("DATABASE_USERNAME"),
System.getenv("DATABASE_PASSWORD"),
System.getenv("REDIS_HOST"),
Integer.parseInt(System.getenv("REDIS_PORT"))
);
DataManager dataManager = new DataManager(dataSourceConfig);Note that the DataManager instance will need to be passed around frequently.