From bfd409b00ff64182d9f40dce31ab7221a2dbef96 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 26 Jan 2013 17:12:15 +1100 Subject: [PATCH] blog for the day --- doc/assistant/crashrecovery.png | Bin 0 -> 6594 bytes .../blog/day_176__thread_management.mdwn | 13 +++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 doc/assistant/crashrecovery.png create mode 100644 doc/design/assistant/blog/day_176__thread_management.mdwn diff --git a/doc/assistant/crashrecovery.png b/doc/assistant/crashrecovery.png new file mode 100644 index 0000000000000000000000000000000000000000..fce3805d0f065ac0efcf239965b140e86e72eed5 GIT binary patch literal 6594 zcmZXZbx_I3KT08cPQ=)6t@C}F76IR zU!M2g|L$ax%$y`MIg^u5zH<_;rJ)GIrNjjQ0HmxWr}NbBJylO^)Tb7V9#s9*;Xsv) z-2s5$X@Fo4#dS0&`N@dop{y>CwTwcEN$_H4@)Y`HqVSM6@{o0LcDDQA0m!=9z4frO z1$#q09Kedo>RN_D1msV1#Fgb_^n4Z%vSE6rbJ+tOE)$8gZ?L%|t40V=xqN!Ms%fnM zev3wOcxLdciznu&`A+g@t7Uo>O?gb_xGjETR!_~V~9L*lCC5?z_4y^RadV=$n%ZN9LBJf$iexWZD zl8^AoQnRZBk;zt5$8)_s^z7z05@1odT%@lZU>9D^6OO5S_V#c%4Y>}te}f@=8o!dt zJ?CpZBvc)Y6Z#KRn>&alO&W~*is(x)j$9Wy>XSj5ObtwgLHcAs&$mKF0pzsF&|k9Y z5}|98g$LuDNw+&6kT3o+WmKljg+QD-xMhiJ=X(1ZS0vq54;X&_Of^3w)^&X_Hx*oN zwwvM*%Cy1+Dx$C*X5$%+Q=Z8XJuOvH`^2w~sPSt@=7X`R2b2>=#-ziL22GK&qk3;9 z>xNsG8DgbQdM?k%3r^Mh{&fWIr1#1lystNzs$fPb_puct9ybGn^9u@kkSB~xJGgjm zTt+Qf8sxvu`uh65Lxv4cgcp*S<~Sn0uv-ELTU?S4y@dAFLuM?{J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evFYu73f738nil}B{i8Ccansv zC88mk-yp1^u^RHNDC}M*SfM9g`1**QAO(d&oniiDYs~zyr2*kOO@Q+Tt3wNm} z%x>mtI3&GNvUN<$;@_s#Uj}lu!lb~u1h{Fg3BD$Y?fSw#VZ&y-xWoB!4JOev4qidQ zZ){{~ZdUls*%?o>? zI|OKc68hYBmn^hyX^Ma8rzvD^@0)82kWBlxbou?2eynSC>AT`HK05J1b@|YVYaBdHr0eZ`5(TbACHhD2cu#*Og0Q*xYTNz<6Qv zL#e5Ie=!xdPj%bnydA_w>k{UsVpOh|#|3X0Z}1X;GT?>a`lDnK$sVPm3)YO6K*#X} zs?t9b3h&C(MkcfEpD6^Y%wI=5$kB#PX$wAic=7VOd5CTLW3{Ir=;Q?d+LF`mMVJzF z@t5VCZR1ZyX79hgV zY+MeGD@xm7Zaz+xp^WE_jAO?6zsdUlP3GS*u%*3|el?HnP9b0P;vy8cNaQCy?zd!Y zcf(F=xDJHbfIAmQSx*iHcfnsK&HZO3$+0X6M3RqJ%*#B6-q$%oIR8t)q(f*kTHkk8 y1J$$iuDN;jr?>L$gX9n~_WynpaO*$N$?=f<#(w{L>FKitP?pz_t9WA-{Qm%w^{Hh5 literal 0 HcmV?d00001 diff --git a/doc/design/assistant/blog/day_176__thread_management.mdwn b/doc/design/assistant/blog/day_176__thread_management.mdwn new file mode 100644 index 0000000000..38f043fcfb --- /dev/null +++ b/doc/design/assistant/blog/day_176__thread_management.mdwn @@ -0,0 +1,13 @@ +Got back to hacking today, and did something I've wanted to do for some +time. Made all the assistant's threads be managed by a thread manager. This +allows restarting threads if they crash, by clicking a button in the +webapp. It also will allow for other features later, like stopping and +starting the watcher thread, to pause the assistant adding local files. + +[[!img /assistant/crashrecovery.png]] + +I added the haskell async library as a dependency, which made this pretty +easy to implement. The only hitch is that async's documentation is not +clear about how it handles asyncronous exceptions. It took me quite a while +to work out why the errors I'd inserted into threads to test were crashing +the whole program rather than being caught!