invoke method
Invokes the global JS function fn with JSON-able args; resolves with
a JSON-able result. Implementations enforce timeout (kill/dispose on
overrun => TimeoutException).
Implementation
@override
Future<Object?> invoke(String fn, List<Object?> args, {Duration? timeout}) {
_checkRunnable();
final id = _router.beginInvoke(fn, args);
_send(jsonEncode(_router.invokePayload(id, fn, args)));
return _router.response(id, fn, timeout, _killStuck);
}