Skip to content
This repository was archived by the owner on Apr 23, 2023. It is now read-only.

Commit 0a03e00

Browse files
author
Jack Tang
committed
Release 0.1.1
1 parent 3b63fcb commit 0a03e00

File tree

2 files changed

+52
-18
lines changed

2 files changed

+52
-18
lines changed

docs/index.html

Lines changed: 51 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -102,19 +102,23 @@ <h1 class="title">threadproxy</h1>
102102
<ul class="simple simple-toc-section">
103103
<li><a class="reference" href="#ThreadProxyError"
104104
title="ThreadProxyError = object of CatchableError"><wbr />Thread<wbr />Proxy<wbr />Error<span class="attachedType"></span></a></li>
105-
<li><a class="reference" href="#TargetNotFoundError"
106-
title="TargetNotFoundError = object of ThreadProxyError
105+
<li><a class="reference" href="#ThreadNotFoundError"
106+
title="ThreadNotFoundError = object of ThreadProxyError
107+
threadName: string"><wbr />Thread<wbr />Not<wbr />Found<wbr />Error<span class="attachedType"></span></a></li>
108+
<li><a class="reference" href="#ReceiverNotFoundError"
109+
title="ReceiverNotFoundError = object of ThreadProxyError
107110
sender: string
108-
target: string"><wbr />Target<wbr />Not<wbr />Found<wbr />Error<span class="attachedType"></span></a></li>
109-
<li><a class="reference" href="#ActionConflictError"
110-
title="ActionConflictError = object of ThreadProxyError
111-
action: string"><wbr />Action<wbr />Conflict<wbr />Error<span class="attachedType"></span></a></li>
111+
receiver: string"><wbr />Receiver<wbr />Not<wbr />Found<wbr />Error<span class="attachedType"></span></a></li>
112112
<li><a class="reference" href="#MessageUndeliveredError"
113113
title="MessageUndeliveredError = object of ThreadProxyError
114114
kind: ThreadMessageKind
115115
action: string
116116
sender: string
117117
data: JsonNode"><wbr />Message<wbr />Undelivered<wbr />Error<span class="attachedType"></span></a></li>
118+
<li><a class="reference" href="#ActionConflictError"
119+
title="ActionConflictError = object of ThreadProxyError
120+
threadName: string
121+
action: string"><wbr />Action<wbr />Conflict<wbr />Error<span class="attachedType"></span></a></li>
118122
<li><a class="reference" href="#NameConflictError"
119123
title="NameConflictError = object of ThreadProxyError
120124
threadName: string"><wbr />Name<wbr />Conflict<wbr />Error<span class="attachedType"></span></a></li>
@@ -208,6 +212,10 @@ <h1 class="title">threadproxy</h1>
208212
title="createToken(proxy: MainThreadProxy; name: string): ThreadToken"><wbr />create<wbr />Token<span class="attachedType">MainThreadProxy</span></a></li>
209213
<li><a class="reference" href="#createThread%2CMainThreadProxy%2Cstring%2CThreadMainProc"
210214
title="createThread(proxy: MainThreadProxy; name: string; main: ThreadMainProc)"><wbr />create<wbr />Thread<span class="attachedType">MainThreadProxy</span></a></li>
215+
<li><a class="reference" href="#pinToCpu%2CMainThreadProxy%2Cstring%2CNatural"
216+
title="pinToCpu(proxy: MainThreadProxy; name: string; cpu: Natural)"><wbr />pin<wbr />To<wbr />Cpu<span class="attachedType">MainThreadProxy</span></a></li>
217+
<li><a class="reference" href="#isThreadRunning%2CMainThreadProxy%2Cstring"
218+
title="isThreadRunning(proxy: MainThreadProxy; name: string): bool"><wbr />is<wbr />Thread<wbr />Running<span class="attachedType">MainThreadProxy</span></a></li>
211219

212220
</ul>
213221
</li>
@@ -239,23 +247,23 @@ <h1><a class="toc-backref" href="#7">Types</a></h1>
239247

240248

241249
</dd>
242-
<a id="TargetNotFoundError"></a>
243-
<dt><pre><a href="threadproxy.html#TargetNotFoundError"><span class="Identifier">TargetNotFoundError</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="threadproxy.html#ThreadProxyError"><span class="Identifier">ThreadProxyError</span></a>
244-
<span class="Identifier">sender</span><span class="Other">:</span> <span class="Identifier">string</span>
245-
<span class="Identifier">target</span><span class="Other">:</span> <span class="Identifier">string</span>
250+
<a id="ThreadNotFoundError"></a>
251+
<dt><pre><a href="threadproxy.html#ThreadNotFoundError"><span class="Identifier">ThreadNotFoundError</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="threadproxy.html#ThreadProxyError"><span class="Identifier">ThreadProxyError</span></a>
252+
<span class="Identifier">threadName</span><span class="Other">:</span> <span class="Identifier">string</span>
246253
</pre></dt>
247254
<dd>
248255

249-
256+
Raised when thread with name cannot be found
250257

251258
</dd>
252-
<a id="ActionConflictError"></a>
253-
<dt><pre><a href="threadproxy.html#ActionConflictError"><span class="Identifier">ActionConflictError</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="threadproxy.html#ThreadProxyError"><span class="Identifier">ThreadProxyError</span></a>
254-
<span class="Identifier">action</span><span class="Other">:</span> <span class="Identifier">string</span>
259+
<a id="ReceiverNotFoundError"></a>
260+
<dt><pre><a href="threadproxy.html#ReceiverNotFoundError"><span class="Identifier">ReceiverNotFoundError</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="threadproxy.html#ThreadProxyError"><span class="Identifier">ThreadProxyError</span></a>
261+
<span class="Identifier">sender</span><span class="Other">:</span> <span class="Identifier">string</span>
262+
<span class="Identifier">receiver</span><span class="Other">:</span> <span class="Identifier">string</span>
255263
</pre></dt>
256264
<dd>
257265

258-
266+
raised whenever thread with name not found
259267

260268
</dd>
261269
<a id="MessageUndeliveredError"></a>
@@ -267,7 +275,17 @@ <h1><a class="toc-backref" href="#7">Types</a></h1>
267275
</pre></dt>
268276
<dd>
269277

278+
raised when message cannot be send to channel
270279

280+
</dd>
281+
<a id="ActionConflictError"></a>
282+
<dt><pre><a href="threadproxy.html#ActionConflictError"><span class="Identifier">ActionConflictError</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="threadproxy.html#ThreadProxyError"><span class="Identifier">ThreadProxyError</span></a>
283+
<span class="Identifier">threadName</span><span class="Other">:</span> <span class="Identifier">string</span>
284+
<span class="Identifier">action</span><span class="Other">:</span> <span class="Identifier">string</span>
285+
</pre></dt>
286+
<dd>
287+
288+
raised when registering action with non-unique name
271289

272290
</dd>
273291
<a id="NameConflictError"></a>
@@ -276,7 +294,7 @@ <h1><a class="toc-backref" href="#7">Types</a></h1>
276294
</pre></dt>
277295
<dd>
278296

279-
297+
raise when creating thread with non-unique name
280298

281299
</dd>
282300
<a id="ThreadMessageKind"></a>
@@ -528,6 +546,22 @@ <h1><a class="toc-backref" href="#12">Procs</a></h1>
528546

529547
Create new thread managed by <tt class="docutils literal"><span class="pre">proxy</span></tt> with an unique <tt class="docutils literal"><span class="pre">name</span></tt>
530548

549+
</dd>
550+
<a id="pinToCpu,MainThreadProxy,string,Natural"></a>
551+
<dt><pre><span class="Keyword">proc</span> <a href="#pinToCpu%2CMainThreadProxy%2Cstring%2CNatural"><span class="Identifier">pinToCpu</span></a><span class="Other">(</span><span class="Identifier">proxy</span><span class="Other">:</span> <a href="threadproxy.html#MainThreadProxy"><span class="Identifier">MainThreadProxy</span></a><span class="Other">;</span> <span class="Identifier">name</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">;</span> <span class="Identifier">cpu</span><span class="Other">:</span> <span class="Identifier">Natural</span><span class="Other">)</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma">
552+
<span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ThreadNotFoundError</span><span class="Other">,</span> <span class="Identifier">KeyError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
553+
<dd>
554+
555+
Pin thread <tt class="docutils literal"><span class="pre">name</span></tt> to cpu. Raise ThreadNotFoundError if name not found.
556+
557+
</dd>
558+
<a id="isThreadRunning,MainThreadProxy,string"></a>
559+
<dt><pre><span class="Keyword">proc</span> <a href="#isThreadRunning%2CMainThreadProxy%2Cstring"><span class="Identifier">isThreadRunning</span></a><span class="Other">(</span><span class="Identifier">proxy</span><span class="Other">:</span> <a href="threadproxy.html#MainThreadProxy"><span class="Identifier">MainThreadProxy</span></a><span class="Other">;</span> <span class="Identifier">name</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma">
560+
<span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ThreadNotFoundError</span><span class="Other">,</span> <span class="Identifier">KeyError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
561+
<dd>
562+
563+
Check whether thread is running. Applicable only to threads created with <tt class="docutils literal"><span class="pre">createThread</span></tt>
564+
531565
</dd>
532566

533567
</dl></div>
@@ -558,7 +592,7 @@ <h1><a class="toc-backref" href="#18">Templates</a></h1>
558592
<div class="twelve-columns footer">
559593
<span class="nim-sprite"></span>
560594
<br/>
561-
<small style="color: var(--hint);">Made with Nim. Generated: 2020-05-23 10:34:47 UTC</small>
595+
<small style="color: var(--hint);">Made with Nim. Generated: 2020-05-23 10:51:28 UTC</small>
562596
</div>
563597
</div>
564598
</div>

threadproxy.nimble

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Package
22

3-
version = "0.1.0"
3+
version = "0.1.1"
44
author = "Jack Tang"
55
description = "Simplify Nim Inter-Thread Communication"
66
license = "MIT"

0 commit comments

Comments
 (0)