package
0.0.0-20250107150054-29ca87a6ada0
Repository: https://github.com/luno/lu.git
Documentation: pkg.go.dev

# Functions

ContextLoop is a Process that will fetch a context and run f with that context.
ContextRetry runs the process function until it returns no error once.
ErrorSleepFor will return the same amount of time for every error.
Every returns a schedule which returns a time equally spaced with a period.
HTTP integrates a http.Server as an App Process.
Loop is a Process that will repeatedly call f, logging errors until the process is cancelled.
MakeErrorSleepFunc specifies behaviour for how long to sleep when a function errors repeatedly.
ManyReflexConsumers allows you to take a number of (probably related) specs and ensure that they all run on the same service instance against a given role (and all with the same set of options).
NoOp is a Process which doesn't do anything but runs until the app is terminated.
No description provided by the author
Poll returns a schedule which runs on a given minimum delay (wait) between successful runs.
ReflexConsumer is the most standard function for generating a lu.Process that wraps a reflex consumer/stream loop.
ReflexLiveConsumer will run a consumer on every instance of the service The stream will start from the latest event and the position is not restored on service restart.
Retry runs the process function until it returns no error once.
Scheduled will create a lu.Process which executes according to a Schedule.
SecureHTTP integrates a secure http.Server as an App Process.
SleepFor returns a SleepFunc that returns a fixed sleep duration.
TimeOfDay returns a Schedule that will trigger at the same time every day hour is based on the 24-hour clock.
ToTimezone can be used when a schedule is to be run in a particular timezone.
WithBreakableLoop sets a flag that determines if when an ErrBreakContextLoop is returned from a process function if that context loop itself can be allowed to terminate as well.
WithClock overwrites the clock field with the value provided.
No description provided by the author
WithErrorSleep is a shortcut for WithErrorSleepFunc + ErrorSleepFor The process will sleep for `d` on every error.
WithErrorSleepFunc sets the handler for determining how long to sleep for after an error.
WithMaxErrors sets the number errors that will cause us to give up on the currently running process.
No description provided by the author
No description provided by the author
WithRole allows you to specify a custom role to await on when coordinating services which may be picked up by supporting lu Process builder like ReflexConsumer.
WithSleep is a shortcut for WithSleepFunc + SleepFor.
WithSleepFunc sets the handler for determining how long ot sleep between loops when there was no error.

# Variables

No description provided by the author
ErrBreakContextLoop acts as a translation error between the reflex domain and the lu process one.
FixedInterval is deprecated.

# Interfaces

No description provided by the author

# Type aliases

No description provided by the author
No description provided by the author
ErrorSleepFunc returns how long to sleep when we encounter an error `errCount` is how many times we've had an error, always > 0 `err` is the latest error The function should not call time.Sleep itself, instead it should return the amount of time that will be used with lu.Wait.
No description provided by the author
No description provided by the author
No description provided by the author
Schedule must return a time in the same time.Location as given to it in Next.
No description provided by the author
SleepFunc returns how long to sleep between loops when there was no error.