using event emitter for task processing