Added wait for consumed tasks and idle trimming features