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

jvmMain.assembly.RaptorJobsPlugin.kt Maven / Gradle / Ivy

There is a newer version: 0.26.0
Show newest version
package io.fluidsonic.raptor

import io.fluidsonic.raptor.di.*


private val jobComponentKey = RaptorComponentKey("jobs")


public object RaptorJobsPlugin : RaptorPlugin {

	override fun RaptorPluginCompletionScope.complete() {
		val component = componentRegistry.one(jobComponentKey)
		val registry = component.complete()

		configure(RaptorDIPlugin) {
			di.provide(registry)
		}
	}


	override fun RaptorPluginInstallationScope.install() {
		require(RaptorDIPlugin)

		componentRegistry.register(jobComponentKey, RaptorJobsComponent())
	}


	override fun toString(): String = "jobs"
}


@RaptorDsl
public val RaptorAssemblyScope.jobs: RaptorJobsComponent
	get() = componentRegistry.oneOrNull(jobComponentKey) ?: throw RaptorPluginNotInstalledException(RaptorJobsPlugin)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy