Skip to content

Manager

Zheng Lv edited this page Jun 26, 2016 · 4 revisions

Manager is in charge of dispatching workers.

Manager struct

Manager holds worker instances. At Run(), Manager starts all its workers with worker.RunSync(). It polls all the workers at a specified interval. It triggers a worker to sync if the worker has been idle for another specified interval. (The interval can be configured per worker. See Configuration for details).

Start(), Stop() will temporarily resume, pause the Manager from polling workers. Exit() will terminate RunSync() control flow. These three functions are all synchronized.

Status struct

Status holds the status of a manager and all its workers. GetStatus() can get a snapshot (currently not atomic, however,) from a manager.

Clone this wiki locally