Created event handler for thread machine events primarily to support testing.