MCPcopy Create free account
hub / github.com/BaseXdb/basex / item

Method item

basex-api/src/main/java/org/basex/query/func/ws/WsEval.java:21–43  ·  view source on GitHub ↗
(final QueryContext qc, final InputInfo ii)

Source from the content-addressed store, hash-verified

19 */
20public final class WsEval extends WsFn {
21 @Override
22 public Str item(final QueryContext qc, final InputInfo ii) throws QueryException {
23 final IOContent query = toContent(arg(0), qc);
24 final HashMap<String, Value> bindings = toBindings(arg(1), qc);
25 final WsOptions options = toOptions(arg(2), new WsOptions(), qc);
26
27 final JobOptions jopts = new JobOptions();
28 jopts.set(JobOptions.BASE_URI, toBaseUri(query.url(), options, WsOptions.BASE_URI));
29 jopts.set(JobOptions.ID, options.get(WsOptions.ID));
30
31 final QueryJobSpec spec = new QueryJobSpec(jopts, bindings, query);
32 final WebSocket ws = ws(qc);
33 final Consumer<QueryJobResult> notify = result -> {
34 try {
35 WsPool.send(result.value, ws.id);
36 } catch(final Exception ex) {
37 ws.error(ex);
38 }
39 };
40
41 final QueryJob job = new QueryJob(spec, qc.context, info, notify);
42 return Str.get(job.jc().id());
43 }
44}

Callers

nothing calls this directly

Calls 14

sendMethod · 0.95
errorMethod · 0.95
getMethod · 0.95
toContentMethod · 0.80
toBindingsMethod · 0.80
toOptionsMethod · 0.80
toBaseUriMethod · 0.80
jcMethod · 0.80
setMethod · 0.65
getMethod · 0.65
idMethod · 0.65
argMethod · 0.45

Tested by

no test coverage detected