package
0.0.0-20181025162720-c8a214aafdbb
Repository: https://github.com/turbinelabs/nonstdlib.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# Functions

No description provided by the author
NewConstantDelayFunc creates a DelayFunc where all retries occur after a fixed delay.
NewError produces a Try representing a failed computation.
NewExecutor constructs a new Executor.
NewExponentialDelayFunc creates a new DelayFunc where the first retry occurs after a duration of delay and each subsequent retry is delayed by twice the previous delay.
NewFromFlags constructs a FromFlags with application-agnostic default flag values.
NewFromFlagsWithDefaults constructs a FromFlags with application-provided default flag values.
NewGoroutineExecutor constructs a new Executor.
NewLoggingDiagnosticsCallback creates an implementation of DiagnosticsCallback that logs diagnostics information periodically.
NewMockDiagnosticsCallback creates a new mock instance.
NewMockExecutor creates a new mock instance.
NewMockFromFlags creates a new mock instance.
NewNoopDiagnosticsCallback creates an implementation of DiagnosticsCallback that does nothing.
NewReturn produces a Try representing a successful computation.
NewTry produces a Try based oen the given interface{} and error.
WithAttemptTimeout sets the timeout for completion individual attempts of an action.
WithDiagnostics sets a DiagnosticsCallback for the Executor.
WithLogger sets a Logger for panics recovered while executing actions.
WithMaxAttempts sets the absolute maximum number of attempts made to complete an action (including the initial attempt).
WithParallelism sets the number of goroutines used to execute actions.
WithRetryDelayFunc sets the DelayFunc used when retrying actions.
WithTimeout sets the timeout for completion of actions.
WithTimeSource sets the tbntime.Source used for obtaining the current time.

# Constants

AttemptCancellation indicates the task was canceled (typically because another task within an ExecGathered call failed).
AttemptError indicates that the attempt failed because it returned an error.
AttemptGlobalTimeout indicates the attempt timed out because the overall time out for the task's execution expired.
AttemptSuccess indicates the attempt succeeded.
AttemptTimeout indicates the attempt timed out.
ConstantDelayType specifies a constant delay between retries.
ExponentialDelayType specifies an exponentially increasing delay between retries.

# Structs

FromFlagsDefaults represents default values for Executor flags.
MockDiagnosticsCallback is a mock of DiagnosticsCallback interface.
MockDiagnosticsCallbackMockRecorder is the mock recorder for MockDiagnosticsCallback.
MockExecutor is a mock of Executor interface.
MockExecutorMockRecorder is the mock recorder for MockExecutor.
MockFromFlags is a mock of FromFlags interface.
MockFromFlagsMockRecorder is the mock recorder for MockFromFlags.

# Interfaces

DiagnosticsCallback provides information about tasks and attempts within an Executor.
Executor invokes functions asynchronously with callbacks on completion and automatic retries, if configured.
FromFlags validates and constructs an Executor from command line flags.
Try represents the result of a computation, which may return a value or an error.

# Type aliases

AttemptResult represents whether or not a task attempt (e.g.
CallbackFunc is invoked at most once to return the result of Func.
DelayFunc is invoked to compute a new deadline.
DelayType represents an algorithm for computing retry delays.
Func is invoked to execute an action.
ManyCallbackFunc invoked at most once each for functions invoked via a single ExecMany call.
Option is used to supply configuration for an Executor implementation.