News for hackers. Stuff that matters.
Re:How to unit-test asynchronous operations? by antonovka on Sunday August 23, 2009 @02:14PM (#780740)
The general answer for event-based systems is: reentrantly spin the event loop from the test and block waiting on the result.

The general answer for actor-based systems is: wait on a blocking message receive from the actor task.

The general answer for simple shared mutable state thread-systems is: Write a complex condition-lock and thread combination (which will probably be subtly wrong the first time) to block your thread and wait on the result triggering the condition.

There are no comments on this comment yet.