infra

package
v1.14.4 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DrainCtrl

func DrainCtrl(ctx api.StreamContext, signal any, ctrlCh chan<- any)

DrainCtrl a non-block function to send out the signal to the ctrl channel It will retry in blocking mode once the channel is full and make sure it is delivered finally but may lose order

func DrainError

func DrainError(ctx api.StreamContext, err error, errCh chan<- error)

DrainError a non-block function to send out the error to the error channel Only the first error will be sent out and received then the rule will be terminated Thus the latter error will just skip It is usually the error outlet of a op/rule.

func SafeRun

func SafeRun(fn func() error) (err error)

SafeRun will catch and return the panic error together with other errors When running in a rule, the whole rule must be in this mode The sub processes or go routines under a rule should also use this mode To make sure all rule panic won't affect the whole system Also consider running in this mode if the function should not affect the whole system

Types

This section is empty.

Jump to

Keyboard shortcuts

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