public class Callback extends Object
| Constructor and Description |
|---|
Callback(org.mozilla.javascript.Scriptable function,
RhinoEngine engine,
boolean sync) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equalsCallback(org.mozilla.javascript.Scriptable callback)
Tests whether the argument is a callback and represents the same
function as this callback.
|
Object |
invoke(Object... args)
Invokes the callback with the given arguments, returning the return value
or a future depending on whether this Callback is synchronous or not.
|
public Callback(org.mozilla.javascript.Scriptable function,
RhinoEngine engine,
boolean sync)
function - either a JavaScript function or a JavaScript object
containing properties called `module` and `name`
specifying a function exported by a RingoJS module.engine - the RhinoEngine instancesync - whether to invoke the callback synchronously (on the current
thread) or asynchronously (on the worker's event loop thread)public boolean equalsCallback(org.mozilla.javascript.Scriptable callback)
callback - a JavaScript function or objectpublic Object invoke(Object... args)
args - arguments to pass to the callback.Future that will resolve to the invocation
in case it is an asynchronous callback.Copyright © 2016. All rights reserved.