Mailspring/docs/BufferedProcess.html
2015-10-03 13:39:16 -07:00

99 lines
2.9 KiB
HTML

---
layout: docs
title: BufferedProcess
edit_url: "https://github.com/nylas/N1/blob/master/src/buffered-process.coffee"
---
<h2>Summary</h2>
<div class="markdown-from-sourecode">
<p><p>A wrapper which provides standard error/output line buffering for
Node&#39;s ChildProcess.</p>
</p>
</div>
<ul>
<li><a href="#Construction">Construction</a></li>
<li><a href="#Event Subscription">Event Subscription</a></li>
<li><a href="#Helper Methods">Helper Methods</a></li>
</ul>
<h3>Instance Methods</h3>
<h4 id=constructor class="function-name">
constructor(<span class="args"><span class="arg">options</span></span>) <a href="#constructor" class="link"></a>
</h4>
<div class="function-description markdown-from-sourecode">
<p><p>Runs the given command by spawning a new child process.</p>
</p>
</div>
<strong>Parameters</strong>
<table class="arguments">
<tr>
<th>Argument</th>
<th>Description</th>
</tr>
<tr>
<td style="width:15%;">
<em>options</em>
</td>
<td class="markdown-from-sourecode">
<p>An <a href='https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/object'>Object</a> with the following keys:</p>
</td>
</tr>
</table>
<h4 id=onWillThrowError class="function-name">
onWillThrowError(<span class="args"><span class="arg">callback</span></span>) <a href="#onWillThrowError" class="link"></a>
</h4>
<div class="function-description markdown-from-sourecode">
<p><p>Will call your callback when an error will be raised by the process.
Usually this is due to the command not being available or not on the PATH.
You can call <code>handle()</code> on the object passed to your callback to indicate
that you have handled this error.</p>
</p>
</div>
<strong>Parameters</strong>
<table class="arguments">
<tr>
<th>Argument</th>
<th>Description</th>
</tr>
<tr>
<td style="width:15%;">
<em>callback</em>
</td>
<td class="markdown-from-sourecode">
<p><a href='https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/function'>Function</a> callback</p>
</td>
</tr>
</table>
<strong>Returns</strong>
<table class="arguments">
<tr>
<th>Return Values</th>
</tr>
<tr><td class="markdown-from-sourecode"><p>Returns a {Disposable}</p>
</td></tr>
</table>
<h4 id=kill class="function-name">
kill(<span class="args"></span>) <a href="#kill" class="link"></a>
</h4>
<div class="function-description markdown-from-sourecode">
<p><p>Terminate the process. </p>
</p>
</div>