Multitask learning with different datasets

I want to train 5 tasks on 5 different datasets. Each batch should be from the dataset. What is the recommended way to write dataset, dataloader, or other methods.