This would register processes for the player, like a linear statemachine. For example, when a player first joins the game, they should be asked what their profession and class is. There might also be information the server might want to say, etc. This API would queue these processes/actions according to a priority. Priority 1 would be a forced action as soon as the player joins, before they are allowed to do anything else, priority 100 would be "who cares so long as it happens eventually". You could also set a flag for persistence. You don't want to select a class every time you join so it should remember that player has already completed that action.
tal_process_queue.register_process({
on_start = function(self, player, meta) end,
on_end = function(self, player, meta) end,
on_step = function(self, player, dtime, meta)
if self.is_finished then return true end
end,
is_persistent = true,
})
tal_process_queue.get_process(player)
tal_process_queue.set_process(player, process_name)
tal_process_queue.skip_process(player, process_name)
tal_process_queue.is_process_finished(player, process_name)