@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface Callback
Environment
to mark
them for exposure to computers.
Object[] f(Context context, Arguments arguments) throws Exception;
Modifier and Type | Optional Element and Description |
---|---|
boolean |
direct
Whether this function may be called directly from the computer's executor
thread instead of from the server thread.
|
java.lang.String |
doc
A documentation string that is made available to the computers the
component this callback belongs to is connected to.
|
boolean |
getter
Whether this callback should work like a getter.
|
int |
limit
The maximum number of direct calls that may be performed on this
component in a single tick on a tier two computer.
|
boolean |
setter
Whether this callback should work like a setter.
|
java.lang.String |
value
The name under which to make the callback available.
|
public abstract java.lang.String value
public abstract boolean direct
Network
is not thread safe!
Be sure you know what you're doing if you're working with a node's
network in a direct callback.
Connector.changeBuffer(double)
,
which is synchronized, so you can consume/produce power in direct calls.public abstract int limit
Component.invoke(String, Context, Object...)
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.
public abstract java.lang.String doc
public abstract boolean getter
public abstract boolean setter