boobst
Version:
Simple Node.js Caché driver
3,140 lines (804 loc) • 36.1 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: BoobstSocket</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: BoobstSocket</h1>
<section>
<header>
<h2>BoobstSocket</h2>
</header>
<article>
<div class="container-overview">
<h4 class="name" id="BoobstSocket"><span class="type-signature"></span>new BoobstSocket<span class="signature">(options)</span><span class="type-signature"></span></h4>
<div class="description">
Boobst Socket
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>port</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">port</td>
</tr>
<tr>
<td class="name"><code>host</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">host</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>emit</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="boobst.js.html">boobst.js</a>, <a href="boobst.js.html#line156">line 156</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Extends</h3>
<ul>
<li>events.EventEmitter</li>
</ul>
<h3 class="subsection-title">Members</h3>
<h4 class="name" id="host"><span class="type-signature"></span>host<span class="type-signature"> :string</span></h4>
<div class="description">
Host
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">string</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="boobst.js.html">boobst.js</a>, <a href="boobst.js.html#line183">line 183</a>
</li></ul></dd>
</dl>
<h4 class="name" id="id"><span class="type-signature"></span>id<span class="type-signature"> :number</span></h4>
<div class="description">
Server's process id
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">number</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="boobst.js.html">boobst.js</a>, <a href="boobst.js.html#line161">line 161</a>
</li></ul></dd>
</dl>
<h4 class="name" id="onConnectionCallback"><span class="type-signature"></span>onConnectionCallback<span class="type-signature"> :function</span></h4>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">function</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="boobst.js.html">boobst.js</a>, <a href="boobst.js.html#line219">line 219</a>
</li></ul></dd>
</dl>
<h4 class="name" id="order"><span class="type-signature"></span>order<span class="type-signature"></span></h4>
<div class="description">
Returns next subscript based on current
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="boobst.js.html">boobst.js</a>, <a href="boobst.js.html#line645">line 645</a>
</li></ul></dd>
</dl>
<h4 class="name" id="port"><span class="type-signature"></span>port<span class="type-signature"> :number</span></h4>
<div class="description">
Port
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">number</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="boobst.js.html">boobst.js</a>, <a href="boobst.js.html#line178">line 178</a>
</li></ul></dd>
</dl>
<h4 class="name" id="queue"><span class="type-signature"></span>queue<span class="type-signature"> :Array</span></h4>
<div class="description">
Commands queue
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Array</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="boobst.js.html">boobst.js</a>, <a href="boobst.js.html#line173">line 173</a>
</li></ul></dd>
</dl>
<h4 class="name" id="saveObject"><span class="type-signature"></span>saveObject<span class="type-signature"></span></h4>
<div class="description">
Save javascript-оbject in Cache'
</div>
<dl class="details">
<dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="boobst.js.html">boobst.js</a>, <a href="boobst.js.html#line637">line 637</a>
</li></ul></dd>
</dl>
<h4 class="name" id="socket"><span class="type-signature"></span>socket<span class="type-signature"> :net.Socket</span></h4>
<div class="description">
Connection socket
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">net.Socket</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="boobst.js.html">boobst.js</a>, <a href="boobst.js.html#line194">line 194</a>
</li></ul></dd>
</dl>
<h4 class="name" id="version"><span class="type-signature"></span>version<span class="type-signature"> :number</span></h4>
<div class="description">
Protocol varsion
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">number</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="boobst.js.html">boobst.js</a>, <a href="boobst.js.html#line167">line 167</a>
</li></ul></dd>
</dl>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="blob"><span class="type-signature"></span>blob<span class="signature">(uri, stream, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
Send binary data
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>uri</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last">uri format is: file://<file_path> or global://<global_name_w/o_^></td>
</tr>
<tr>
<td class="name"><code>stream</code></td>
<td class="type">
<span class="param-type">Stream</span>
</td>
<td class="attributes">
</td>
<td class="description last">data stream</td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">callback</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="boobst.js.html">boobst.js</a>, <a href="boobst.js.html#line708">line 708</a>
</li></ul></dd>
</dl>
<h4 class="name" id="connect"><span class="type-signature"></span>connect<span class="signature">(callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {boobst.BoobstSocket}</span></h4>
<div class="description">
Connect to DB
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">callback</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="boobst.js.html">boobst.js</a>, <a href="boobst.js.html#line211">line 211</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">boobst.BoobstSocket</span>
</dd>
</dl>
<h4 class="name" id="disconnect"><span class="type-signature"></span>disconnect<span class="signature">(callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
Disconnect from the db
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">callback</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="boobst.js.html">boobst.js</a>, <a href="boobst.js.html#line779">line 779</a>
</li></ul></dd>
</dl>
<h4 class="name" id="execute"><span class="type-signature"></span>execute<span class="signature">(name, outStream<span class="signature-attributes">opt</span>, callback)</span><span class="type-signature"></span></h4>
<div class="description">
Execute routine
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last">имя существующей команды</td>
</tr>
<tr>
<td class="name"><code>outStream</code></td>
<td class="type">
<span class="param-type">stream.Stream</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">поток, в который пересылать ответ сервера</td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
</td>
<td class="description last">callback</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="boobst.js.html">boobst.js</a>, <a href="boobst.js.html#line433">line 433</a>
</li></ul></dd>
</dl>
<h4 class="name" id="flush"><span class="type-signature"></span>flush<span class="signature">(callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
Clear the local namespace and set the server variables again
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">callback</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="boobst.js.html">boobst.js</a>, <a href="boobst.js.html#line729">line 729</a>
</li></ul></dd>
</dl>
<h4 class="name" id="get"><span class="type-signature"></span>get<span class="signature">(name, subscript<span class="signature-attributes">opt</span>, forceJSON<span class="signature-attributes">opt</span>, callback)</span><span class="type-signature"></span></h4>
<div class="description">
Get value
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last">Name of variable or global node</td>
</tr>
<tr>
<td class="name"><code>subscript</code></td>
<td class="type">
<span class="param-type">Array.<string></span>
|
<span class="param-type">boolean</span>
|
<span class="param-type">function</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>forceJSON</code></td>
<td class="type">
<span class="param-type">boolean</span>
|
<span class="param-type">function</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">force get JSON from node</td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
</td>
<td class="description last">Callback-function (error, data)</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="boobst.js.html">boobst.js</a>, <a href="boobst.js.html#line484">line 484</a>
</li></ul></dd>
</dl>
<h4 class="name" id="kill"><span class="type-signature"></span>kill<span class="signature">(name, subscripts<span class="signature-attributes">opt</span>, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
Kill a global or a local
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>subscripts</code></td>
<td class="type">
<span class="param-type">Array.<string></span>
|
<span class="param-type">function</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">callback</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="boobst.js.html">boobst.js</a>, <a href="boobst.js.html#line688">line 688</a>
</li></ul></dd>
</dl>
<h4 class="name" id="ping"><span class="type-signature"></span>ping<span class="signature">(callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
Check server state
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">callback</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="boobst.js.html">boobst.js</a>, <a href="boobst.js.html#line738">line 738</a>
</li></ul></dd>
</dl>
<h4 class="name" id="set"><span class="type-signature"></span>set<span class="signature">(name, subscripts<span class="signature-attributes">opt</span>, value, callback<span class="signature-attributes">opt, nullable</span>)</span><span class="type-signature"> → {boobst.BoobstSocket|<a href="BoobstSocket.html">BoobstSocket</a>}</span></h4>
<div class="description">
Set the value of variable or global
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last">variable or global name (global name starts with `^`)</td>
</tr>
<tr>
<td class="name"><code>subscripts</code></td>
<td class="type">
<span class="param-type">string</span>
|
<span class="param-type">Buffer</span>
|
<span class="param-type">Array.<string></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">string</span>
|
<span class="param-type">Buffer</span>
|
<span class="param-type">function</span>
|
<span class="param-type">number</span>
|
<span class="param-type">Date</span>
</td>
<td class="attributes">
</td>
<td class="description last">variable value</td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
<optional><br>
<nullable><br>
</td>
<td class="description last">callback</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="boobst.js.html">boobst.js</a>, <a href="boobst.js.html#line536">line 536</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">boobst.BoobstSocket</span>
|
<span class="param-type"><a href="BoobstSocket.html">BoobstSocket</a></span>
</dd>
</dl>
<h4 class="name" id="xecute"><span class="type-signature"></span>xecute<span class="signature">(xecute, outStream<span class="signature-attributes">opt</span>, callback)</span><span class="type-signature"></span></h4>
<div class="description">
Evaluates any code on the server. Dangerous thing disabled on server by default
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>xecute</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last">text to xecute</td>
</tr>
<tr>
<td class="name"><code>outStream</code></td>
<td class="type">
<span class="param-type">stream.Stream</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">stream to send data</td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
</td>
<td class="description last">callback</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="boobst.js.html">boobst.js</a>, <a href="boobst.js.html#line458">line 458</a>
</li></ul></dd>
</dl>
<h4 class="name" id="zn"><span class="type-signature"></span>zn<span class="signature">(name, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
Changes namespace
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last">existing namespace</td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">callback</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="boobst.js.html">boobst.js</a>, <a href="boobst.js.html#line660">line 660</a>
</li></ul></dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BoobstSocket.html">BoobstSocket</a></li></ul><h3>Global</h3><ul><li><a href="global.html#BCMD">BCMD</a></li><li><a href="global.html#net">net</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Wed Aug 03 2016 15:56:44 GMT+0300 (MSK)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>