You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 3, 2019. It is now read-only.
I tried this code (in Kotlin, but I guess it shouldn't matter),
All it does: creates PostgreSQLConnection with all default values, calls connect method on it, does nothing with the returned Future, and measures elapsed time.
If this call has to be blocking then maybe there's little point in returning Future because it doesn't save anything here, or maybe it's just a bug.
import com.github.mauricio.async.db.postgresql.PostgreSQLConnection
import com.github.mauricio.async.db.postgresql.column.PostgreSQLColumnDecoderRegistry
import com.github.mauricio.async.db.postgresql.column.PostgreSQLColumnEncoderRegistry
import com.github.mauricio.async.db.postgresql.util.URLParser
import com.github.mauricio.async.db.util.ExecutorServiceUtils
import com.github.mauricio.async.db.util.NettyUtils
import kotlin.system.measureTimeMillis
fun main(args: Array<String>) {
println(measureTimeMillis {
PostgreSQLConnection(
URLParser.DEFAULT(),
PostgreSQLColumnEncoderRegistry.Instance(),
PostgreSQLColumnDecoderRegistry.Instance(),
NettyUtils.DefaultEventLoopGroup(),
ExecutorServiceUtils.CachedExecutionContext()
).connect()
}) // prints something close to 5862 on my machine
}
I can translate it to Scala if you wish, that's not a big deal.
I'm using this library version: 'postgresql-async_2.12', version: "0.2.21"