Updated Callback.limit documentation.

[ci skip]
This commit is contained in:
Florian Nücke 2014-10-17 19:20:31 +02:00
parent f82669e3df
commit f5c19e9e7e

View File

@ -52,12 +52,15 @@ public @interface Callback {
* Keep in mind that the node {@link li.cil.oc.api.network.Network} is <em>not</em> thread safe!
* Be sure you know what you're doing if you're working with a node's
* network in a direct callback.
* <p/>
* An exception to that rule is {@link li.cil.oc.api.network.Connector#changeBuffer(double)},
* which is synchronized, so you can consume/produce power in direct calls.
*/
boolean direct() default false;
/**
* The maximum number of direct calls that may be performed on this
* component in a single <em>tick</em>.
* component in a single <em>tick</em> on a tier two computer.
* <p/>
* This can be used to throttle call speed. For example, this is used by
* graphics cards to limit the amount of net traffic can be generated by
@ -74,8 +77,13 @@ public @interface Callback {
* from the host side. Also, this limit is per-computer, so the method may
* be invoked more often than this per tick, if different computers call it.
* <p/>
* An exception to that rule is {@link li.cil.oc.api.network.Connector#changeBuffer(double)},
* which is synchronized, so you can consume/produce power in direct calls.
* Note that the interpretation of this value changed a bit in OC 1.4.
* Before, it was the actual number of calls that could be performed on
* the component per tick. Now it's more of a general cost value: for each
* direct call a computer makes, <tt>1/limit</tt> is subtracted from the
* computer's call budget. This budget may vary between computers, for
* example, tier three computers have a higher call budget than tier two
* computers.
*/
int limit() default Integer.MAX_VALUE;