Skip to main content

Tegral Services

Tegral Services is a simple API for defining startable and stoppable services.

These services are simply classes that implement TegralService and that get put in a services-enabled Tegral DI environment

In order to make using services easier, Tegral Services also provides a feature (ServicesFeature) that automatically sets up the Tegral DI services extension for you when enabled.

Package information
Package nameCatalog dependencyFull Gradle name
tegral-services-apitegralLibs.services.apiguru.zoroark.tegral:tegral-services-api:VERSION
tegral-services-featuretegralLibs.services.featureguru.zoroark.tegral:tegral-services-feature:VERSION

Writing services

Services can be written simply by implementing the TegralService interface and implementing relevant functions:

class MyService : TegralService {
override suspend fun start() {
// ...
}

override suspend fun stop() {
// ...
}
}