Documentation ¶
Index ¶
Constants ¶
View Source
const ( DEFAULT_APP_CONFIG = "/data/app.json" SERVICE_STATE_FILE = "/data/__service_state.json" )
Variables ¶
View Source
var DEFAULT_WORKER_START_CONF = obrero.WorkerStartConf{ PoolSize: 2, Duration: 20 * time.Second, RetryDuration: 20 * time.Second, NAGetClientMaxRetry: 3, }
Functions ¶
func StartStdWorker ¶
func StartStdWorker(appConfig interface{}, appState interface{}, getBoxFuncMap GetBoxFuncMap, stdWorkerConfig StdWorkerConfig) napool.NAPools
appConfig: pointer of appConfig appState: pointer of appState
Types ¶
type GetBoxFuncMap ¶
type GetBoxFuncMap = func(*napool.NAPools, *WorkerState, *gopcp_stream.StreamServer) map[string]*gopcp.BoxFunc
(pool, config pointer, stream)
type StdWorkerConfig ¶
type WorkerState ¶
type WorkerState struct { StateFilePath string State State // contains filtered or unexported fields }
func GetWorkerState ¶
func GetWorkerState(stateFilePath string) (*WorkerState, error)
read state from state file
func (*WorkerState) UpdateState ¶
func (ws *WorkerState) UpdateState() error
flush current state to file TODO lock
Click to show internal directories.
Click to hide internal directories.