Changes

Jump to navigation Jump to search
159 bytes removed ,  14:43, 27 February 2020
no edit summary
* The module will be available if the {{Code|basex-api}} library is found in the classpath. This is the case if you use one of the complete distributions of BaseX (zip, exe, war).
* All functions and errors are assigned to the <code><nowiki>http://basex.org/modules/ws</nowiki></code> namespace, which is statically bound to the {{Code|ws}} prefix. Prior to {{Version|9.2}}, the module needed to be imported in the query prolog: <pre class="brush:xquery">import module namespace ws = "http://basex.org/modules/ws";...</pre> 
* As sessions are side-effecting operations, all functions are flagged as ''non-deterministic''. As a result, some query optimizations will be suppressed.
|-
| '''Summary'''
|Returns the ids of all currently registered WebSocketWebSockets.
|}
==ws:eval==
 
{{Mark|Introduced with 9.2:}}
{| width='100%'
|
* Schedule a second query that will notify the client 10 seconds later that a message was processed:
<pre classsyntaxhighlight lang='brush:"xquery'">
declare
%ws:message('/tasks', '{$message}')
ws:eval('prof:sleep(10000), "Your message has been processed."')
};
</presyntaxhighlight>
|}
==Example 1==
<pre classsyntaxhighlight lang="brush:xquery">
import module namespace ws = "http://basex.org/modules/ws";
return ws:broadcast($message)
};
</presyntaxhighlight>
'''Explanation:'''
==Example 2==
<pre classsyntaxhighlight lang="brush:xquery">
import module namespace ws = "http://basex.org/modules/ws";
return ws:emit($message)
};
</presyntaxhighlight>
'''Explanation:'''
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu