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

main.app.cash.backfila.client.misk.hibernate.PrimaryKeyCursorAdapterModule.kt Maven / Gradle / Ivy

Go to download

Backfila is a service that manages backfill state, calling into other services to do batched work.

The newest version!
package app.cash.backfila.client.misk.hibernate

import com.google.inject.AbstractModule
import com.google.inject.TypeLiteral
import com.google.inject.multibindings.MapBinder

class PrimaryKeyCursorAdapterModule(
  private val primaryKeyType: Class,
  private val primaryKeyCursorAdapter: PrimaryKeyCursorAdapter,
) : AbstractModule() {
  override fun configure() {
    MapBinder.newMapBinder(
      binder(),
      object : TypeLiteral>() {},
      object : TypeLiteral>() {},
    ).addBinding(primaryKeyType)
      .toInstance(primaryKeyCursorAdapter)
  }

  companion object {
    inline fun  create(
      primaryKeyCursorAdapter: PrimaryKeyCursorAdapter,
    ): PrimaryKeyCursorAdapterModule {
      return PrimaryKeyCursorAdapterModule(PK::class.java, primaryKeyCursorAdapter)
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy