Used MQ Broker
Tasks work like plugins you need just create a file in folder server/plugins/tasks
and it will be automaticaly loaded on application startup:
export default {
'db.test.account': testAccount
};
function testAccount({ name, options }, cb) {
}
Than you can call this task from your code:
const service = new TasksService();
service.runTask('db.test.account');