问题
are there any approaches, given a statement like the following
First().Second();
to know from within First() whether/when Second() has executed?
Reference: http://martinfowler.com/dslwip/MethodChaining.html
回答1:
Second() will not execute until First() has completed, therefore this is impossible. All that First() can do is to violate fluency, thereby making it impossible for Second() to run.
来源:https://stackoverflow.com/questions/2146623/method-chaining-and-the-finishing-problem