`<node>.isinited` has been removed from the LFC. It has been a private API
since forever. It's name was a lie, because it was actually set to true long
before the node was finished being inited. But, Maynard just brought to my
attention a very common pattern where it was used -- the case where you have
two independent nodes that need to communicate, but you don't know what order
they will be initialized in. The common pattern has been:
Assume node A wants to take some action when node B is ready. In node A you
would have:
<method name="takeAction" args="ignore">
if (this.isinited && B.isReady) { ... }
</method>
<handler name="onisReady" reference="B" method="takeAction" />
<method name="init">
super.init();
this.takeAction();
</method>
In other words you have a guard clause around the body of takeAction that
ensures A is inited and B is ready. Then you can call this method from both a
handler on B's onisReady event, and from your own init method, and it will only
run when both guard clauses are valid.
The problem is that the public `inited` flag is not set until _after_ the call
to <node>/init() is completed (including any overrides). Which means the guard
will fail in the call from the init method.
The workaround is to not call the takeAction method directly from init, but to
add another handler:
<handler name="oninited" method="takeAction" />
This will work, because `inited` will be true when oninited is sent. But it
seems there should be a better way.
One idea would be to add a way to put the guard directly into the handler,
something like:
<handler name="onisReady" reference="B" method="takeAction" when="inited" />
Roughly, this would extend the existing kernel mechanism that queues any events
send during <node>/construct and delivers them when construct is done. We
could create arbitrary queues for flags that acted as guards to delay events.
Comments?