Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
Manager manages scheduled tasks which are run by exactly one server instance in an Oak domain.
func New ¶
New returns a new task manager. coordinationStore is used for ensuring that only one Oak instance within a cluster has the duty of running scheduled tasks (in order to avoid every instance doing the same work, which is wasteful). Every Oak instance within the cluster needs to be connected to the same database for it to work correctly. Note that when initializing Oak servers (or if the Oak server with the duty goes down) it is possible for multiple Oak instances to briefly assign themselves the duty, but only for one round. This will automatically be resolved on the next check and only one will end up with the duty from that point on. This situation should not be of concern since a task should expect this situation. You must register each task you want this service to run on using the Register method. Start must be called to start the service and Stop should be called to stop it.
func (*Manager) InstanceID ¶
InstanceID returns the unique ID of this server instance.