Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var PingInterval = 10 * time.Second
Functions ¶
func New ¶
New returns a Runner that can be used to start workers that will only run a single instance. The conn value is used to determine whether to run the workers or not.
If conn.IsMaster returns true, any workers started will be started on the underlying runner.
If conn.IsMaster returns false, any workers started will actually start do-nothing placeholder workers on the underlying runner that continually ping the connection until a ping fails and then exit with that error.
Types ¶
type Conn ¶
type Conn interface { // IsMaster reports whether this connection is currently held by // the (singular) master of the resource. IsMaster() (bool, error) // Ping probes the resource and returns an error if the the // connection has failed. If the master changes, this method // must return an error. Ping() error }
Conn represents a connection to some resource.
Click to show internal directories.
Click to hide internal directories.