Documentation ¶
Overview ¶
Package server bootstraps and runs the Job Runner.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) Run ¶
Run runs the Job Runner API in the foreground. It returns when the API stops running (either from an error, or after a call to Stop). If a custom RunAPI hook has been provided, it will be called to run the API instead of the default api.Run.
If stopOnSignal = true, the server will listen for TERM and INT signals from the OS and call Stop to shut itself down when those signals are received. Else, the caller must call Stop to shut down the server.
func (*Server) Stop ¶
Stop stops the server. It signals running traversers to shut down and then stops the API (using either the default api.Stop or the StopAPI hook if provided). Once Stop has been called, the server cannot be reused - future calls to Run will return an error.
If stopOnSignal was set when calling Run, Stop will automatically be called by the server on receiving a TERM or INT signal from the OS. Otherwise, you must call Stop when you want to shut down the Job Runner.