Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StdoutListener ¶
StdoutListener replicates the debug prints that were hard-coded in the previous implementation. It serialises the task specification, input and output into JSON and prints them to standard output. Errors from json.Marshal are ignored on purpose – they indicate non-serialisable values and the caller would not have had access to the data either way in the original implementation.
Types ¶
type Listener ¶
Listener is invoked once a task action completes (regardless of whether it returned an error or not). Implementations can log, collect metrics or perform any other side-effects they require.
For convenience the listener is defined as a function type rather than an interface; users can therefore pass a plain function literal when customising the executor.
type Option ¶
type Option func(*service)
Option is used to customise the executor instance.
func WithListener ¶
WithListener overrides the listener invoked after every executed task. Passing nil disables the callback entirely.