scheduler in scala