Documentation ¶
Overview ¶
Package process is a subpackage of coordinator, providing simple way to create and manage processes such as servers, metrics, and profiling in a clean and controlled manner.
This package allows you to focus on the logic for starting and stopping processes within goroutines, while the coordinator handles the application lifecycle.
To use this package, implement the Process interface, which includes methods to trigger events like OnStart and OnStop, ensuring integration and control over your application's processes via coordinator.ServiceCoordinator.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsCriticalToStop ¶
IsCriticalToStop checks if the task is essential for execution.
Types ¶
type Process ¶
type Process interface { // GetName method returns the name of the task. GetName() string // GetSeverity method returns the severity/importance of the task. GetSeverity() Severity // OnStart method is an event to be called when the main loop starts. OnStart(ctx context.Context) error // OnStop method is an event to be called when the main loop stops. OnStop(ctx context.Context) error }
Process interface represents a task that requires execution within a microservice. This could include a variety of tasks such as servers, events, parsers, aggregators, etc.