EndpointResources

app.units.EndpointResources

Provides managed resources for API endpoint initialisation.

This object handles the creation and lifecycle management of API endpoints, such as those for preprocessor services and Reaktoro services. By encapsulating endpoint initialisation in Resource, it ensures proper setup and teardown of these components.

Attributes

Source
EndpointsResources.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def preprocessorEndpointsResource(reactionService: ReactionService[IO], mechanismService: MechanismService[IO])(implicit logger: Logger[IO]): Resource[IO, PreprocessorEndpoints]

Creates a managed resource for the PreprocessorEndpoints.

Creates a managed resource for the PreprocessorEndpoints.

This method initialises and manages the lifecycle of the PreprocessorEndpoints instance, which handles API routes for preprocessor-related services, including reactions and mechanisms. It logs lifecycle events during the resource's creation and release for debugging and monitoring purposes.

Example usage:

 val preprocessorResource = EndpointResources.preprocessorEndpointsResource(
   reactionService,
   mechanismService
 )
 preprocessorResource.use { endpoints =>
   // Use the endpoints to serve HTTP routes
 }

Value parameters

logger

A logger instance for logging lifecycle events.

mechanismService

An instance of MechanismService for handling mechanism-related operations.

reactionService

An instance of ReactionService for handling reaction-related operations.

Attributes

Returns

A Resource encapsulating the PreprocessorEndpoints instance, ensuring proper initialisation and cleanup.

Source
EndpointsResources.scala
def reaktoroEndpointsResource(reaktoroService: ReaktoroService[IO])(implicit logger: Logger[IO]): Resource[IO, ReaktoroEndpoints]

Creates a managed resource for the ReaktoroEndpoints.

Creates a managed resource for the ReaktoroEndpoints.

This method initialises and manages the lifecycle of the ReaktoroEndpoints instance, which handles API routes for Reaktoro-related services. Lifecycle events are logged for better observability during resource creation and release.

Example usage:

 val reaktoroResource = EndpointResources.reaktoroEndpointsResource(reaktoroService)
 reaktoroResource.use { endpoints =>
   // Use the endpoints to serve HTTP routes
 }

Value parameters

logger

A logger instance for logging lifecycle events.

reaktoroService

An instance of ReaktoroService for handling Reaktoro-related operations.

Attributes

Returns

A Resource encapsulating the ReaktoroEndpoints instance, ensuring proper initialisation and cleanup.

Source
EndpointsResources.scala