Documentation
¶
Overview ¶
The schedule package takes care of any "scheduled tasks". Using a combination of Cron and ZeroMQ, the schedule package distributes the consumption of tasks to multiple workers in order to speed up work as much as possible.
Index ¶
Constants ¶
const EmptyQueueSleepDuration time.Duration = time.Duration(time.Second * time.Duration(NumberOfTaskWorkers))
Time that a Worker should sleep/wait in the event of no tasks being ready
const EventHealthTaskCapacity uint8 = 50
Number of Event Health Tasks to pop off of redis Maybe this should be in schedule.go
const HealthTaskPrefix string = "healthTask"
Game Health Checking to garbage collect game data
const MagicRune rune = '~'
Labeled MagicRune as a joke for Golangs named type Used as seperator for communicating work to workers Task Name/Prefix + MagicRune + Params/Data
const NumberOfTaskWorkers uint8 = 10
Number of Workers to Distribute to with ZeroMQ
const ProxyBEPort string = ":5566"
Proxy Sub Port for receiving From (workers)
const ProxyControlPort string = ":5567"
Proxy Control Port for Interrupting Proxy
const ProxyFEPort string = ":5565"
Proxy Publish Port for sending to (application)
const RecvIOTimeoutDuration time.Duration = time.Duration(time.Microsecond)
Time that a worker should spend waiting to receive for new work
const TestTaskPrefix string = "unitTest0"
Unit Testing Prefix for adding to the database using workers
Variables ¶
This section is empty.
Functions ¶
func SendTasksToWorkers ¶ added in v0.0.3
Function used by schedule.go to communicate the scheduled tasks to the workers. This takes an array of Task Name/Prefixes+MagicRune+Data strings and sends them to the proxy (which in turn send them to the workers.).
msg :: slice of string messages to send to workers (Task Name/Prefix+MagicRune+Data)
Returns an Error if communicating fails (server-shutoff or the full message could not be sent).
func StartCronScheduler ¶
func StartCronScheduler() (func(), error)
ServerTask Startup Function for Cron Scheduling. Takes care of initialization.
func StartTaskQueue ¶
func StartTaskQueue() (func(), error)
ServerTask Startup Function for Schedule Task System. Creates Workers and communication channels with ZeroMQ.