Issue solved. Now Slave is a Runnable and fetch tasks via polling