An implementation of task/event based asynchronous pattern.