All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.laserdisc.mysql.binlog.client.package.scala Maven / Gradle / Ivy

package io.laserdisc.mysql.binlog

import cats.effect.Sync
import cats.implicits._
import com.github.shyiko.mysql.binlog.BinaryLogClient
import io.laserdisc.mysql.binlog.checkpoint.BinlogOffset
import io.laserdisc.mysql.binlog.config.{BinLogConfig, BinLogConfigOps}
import org.typelevel.log4cats.Logger

package object client {

  def createBinLogClient[F[_]: Sync: Logger](
      config: BinLogConfig,
      offset: Option[BinlogOffset] = None
  ): F[BinaryLogClient] =
    for {
      client <- Sync[F].delay(config.mkBinaryLogClient(offset))
      _ <-
        Logger[F].info(
          s"Binlog client created with offset ${client.getBinlogFilename} ${client.getBinlogPosition}"
        )
    } yield client
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy