|
|
|
@ -6,22 +6,22 @@ import ( |
|
|
|
|
"time" |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
// Config are the options for creating a new process
|
|
|
|
|
// Config contains the options for creating a new process.
|
|
|
|
|
type Config struct { |
|
|
|
|
|
|
|
|
|
// Start is called by Process.Start. If an error is returned,
|
|
|
|
|
// Start, if non-nil, is called by Process.Start. If an error is returned,
|
|
|
|
|
// starting the process is aborted.
|
|
|
|
|
Start func() error |
|
|
|
|
|
|
|
|
|
// Stop is called by Process.Stop. If an error is returned,
|
|
|
|
|
// Stop, if non-nil, is called by Process.Stop. If an error is returned,
|
|
|
|
|
// stopping the process is aborted.
|
|
|
|
|
Stop func() error |
|
|
|
|
|
|
|
|
|
// If TickDuration is non-zero, the process will count ticks where
|
|
|
|
|
// the process is active or idle, identified as active by calling
|
|
|
|
|
// the Touch() method. When the process has been idle for more than
|
|
|
|
|
// MaxIdleTicks, it will be stopped. If ticking is enabled, TickError
|
|
|
|
|
// must be set or operations will result in a panic.
|
|
|
|
|
// the process is active or idle. Process are kept active by the user
|
|
|
|
|
// calling the Process.Touch() method. When the process has been idle for
|
|
|
|
|
// more than MaxIdleTicks, it will be stopped. If ticking is enabled,
|
|
|
|
|
// TickError must be set or operations will result in a panic.
|
|
|
|
|
TickDuration time.Duration |
|
|
|
|
TickError func(error) |
|
|
|
|
|
|
|
|
|