Skip to content

Tips: init your workers

Andrea Fontana edited this page May 28, 2023 · 1 revision

@onWorkerStart and onWorkerStop

/+
 When a worker is created, this function is called.
 Useful to init database connection & everything else.
+/
@onWorkerStart
void start()
{
   // Connect to db...
}

@onWorkerStop
void stop()
{
   // Close connection
}