Documentation
¶
Overview ¶
Package gate contains a gated function callback registration implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Gate ¶
type Gate[T comparable] struct { // contains filtered or unexported fields }
Gate implements a gated function callback registration with comparable conditions.
func (*Gate[T]) Register ¶
func (g *Gate[T]) Register(fn func(), depends ...T)
Register a callback function that will be called when all the provided dependent conditions are true. After all conditions are true, the callback function is removed from the registration and will not be called again. Thread Safe.
Click to show internal directories.
Click to hide internal directories.