October 2003
Intermediate to advanced
736 pages
15h 25m
English
Peter, his boss, and the universe were finally satisfied. Peter's boss and the universe were allowed to be notified of the events that interested them, reducing the burden of implementation and the cost of unnecessary round-trips. Peter could notify each of them, ignoring how long it took them to return from their target methods while still getting his results asynchronously. The result was the following complete solution:
Delegate Sub WorkStarted() Delegate Sub WorkProgressing() Delegate Function WorkCompleted() As Integer Class Worker Public Event started As WorkStarted Public Event progressing As WorkProgressing Public completed As WorkCompleted Public Sub DoWork() Console.WriteLine("Worker: work started") RaiseEvent ...