interceptor

package
v0.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2021 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultWorkerPool

func DefaultWorkerPool() cronx.Interceptor

DefaultWorkerPool returns a WorkerPool middleware with default configuration.

func Logger

func Logger() cronx.Interceptor

Logger is a middleware that logs the current job start and finish.

func Recover

func Recover() cronx.Interceptor

Recover is a middleware that recovers server from panic. Recover also dumps stack trace on panic occurrence.

func RequestID

func RequestID(
	ctx context.Context,
	job *cronx.Job,
	handler cronx.Handler,
) error

RequestID is a middleware that inject request id to the context if it doesn't exists.

func WorkerPool

func WorkerPool(size int) cronx.Interceptor

WorkerPool is a middleware that limit total cron that can run a time. Program is running on a server with finite amount of resources such as CPU and RAM. By limiting the total number of jobs that can be run the same time, we protect the server from overloading.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL