diff options
Diffstat (limited to 'opendc-common/src/main/kotlin/org/opendc/common/utils/ConfigParser.kt')
| -rw-r--r-- | opendc-common/src/main/kotlin/org/opendc/common/utils/ConfigParser.kt | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/opendc-common/src/main/kotlin/org/opendc/common/utils/ConfigParser.kt b/opendc-common/src/main/kotlin/org/opendc/common/utils/ConfigParser.kt index e6f18da5..8261f6f0 100644 --- a/opendc-common/src/main/kotlin/org/opendc/common/utils/ConfigParser.kt +++ b/opendc-common/src/main/kotlin/org/opendc/common/utils/ConfigParser.kt @@ -13,7 +13,6 @@ import java.net.Socket import java.sql.Connection /** - * @author Mateusz * @property name * @property backlog the amount of connections to accept * @property address IPv4 address @@ -22,8 +21,14 @@ import java.sql.Connection * @property username Postgresql user * @property password Postgresql password * @property database Postgresql database - * @property topic Kafka topic + * @property topic Kafka topic and database table name * @property kafka Kafka port + * @author Mateusz + */ +/* + + Use `by lazy` here. + Use design patterns - singleton. */ @Serializable public data class Config( @@ -50,6 +55,10 @@ public data class Config( public fun setConfigSocket(socket: Socket?){ this.socket = socket + // no try catch if the exception is not from Java + // do not use raw sockets, use a service for the communication + // use redis instead of HTTP GET (consider it, but not bound in stone) + // make an API KTor try { input = socket?.getInputStream() output = socket?.getOutputStream() |
