Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

+ Some graphics

  • Loading branch information...
commit 513e1620e1437b07cb66209960395b112f23c84c 1 parent 4be72d5
@kschiess authored
View
10 website/source/index.html.textile
@@ -1,13 +1,19 @@
+---
+title: cod - ipc, not beards
+---
+
This is a work in progress...
Want to watch this happen? Here's a list of things I've worked on recently
and what I changed:
+h2. 2012-04-02
+
+* Style changes, added a fish image courtesy of "Norwegian Institute of Marine Research":http://www.fisheries.no/ecosystems-and-stocks/marine_stocks/fish_stocks/cod/. (Thanks!)
+
h2. 2012-03-30
* "tutorial/unix":tutorial/unix.html Headlines only; stuff that you need to
be aware of in this mode of programming.
* "tutorial/pipe":tutorial/pipes.html A few examples and the example runner.
Examples for a lot of the pattern you'd need in reality.
-
-Come back later - this is undergoing frequent changes.
View
10 website/source/layout.slim
@@ -17,9 +17,15 @@ html
body onload="sh_highlightDocument();"
a href="#{{asset_url 'tutorial/pipes.html'}}" IO.pipes
+ | -
+ a href="#{{asset_url 'tutorial/pipes.html'}}" TCP streams
+ | -
+ a href="#{{asset_url 'tutorial/pipes.html'}}" Beanstalkd tubes
- #toc
- h1 Table of Contents
+ - if data.page.toc
+ #toc
+ img src="#{{asset_url 'images/fish.png'}}"
+ h1 Table of Contents
== yield
View
6 website/source/stylesheets/site.css.sass
@@ -44,6 +44,9 @@ pre
/* Table of Contents
#toc
+ margin-left: auto
+ margin-right: auto
+ width: 18em
font-size: 1.1em
background-color: #f8f8f8
@@ -74,6 +77,9 @@ pre
ul
padding-left: 0
+ img
+ margin-top: -1.5em
+
.footnote
padding: 0
margin: 0
View
14 website/source/tutorial/pipes.html.textile
@@ -1,5 +1,6 @@
---
title: "Pipes"
+toc: true
---
h1. Pipes
@@ -47,7 +48,7 @@ either end and render them useless:
<pre class="sh_ruby"><code title="Access before fork">
chan = Cod.pipe
- chan.put :smthng # raises <Errno::EPIPE: Broken pipe>
+ chan.put :smthng # raises <Errno::EPIPE: Broken pipe>
fork do
chan.get
end
@@ -111,7 +112,7 @@ Have a look at this nifty trick:
end
end
- channel.get # => #<RuntimeError: Meanwhile, back at th...
+ channel.get # => #<RuntimeError: Meanwhile, back at th...
</code></pre>
One could even raise the error returned in the parent process, simulating a
@@ -149,8 +150,8 @@ And here 's an example of one producer, M consumers:
Worker.new(n)
end
- work = Cod.pipe # for sending work to workers
- result = Cod.pipe # for receiving results from workers
+ work = Cod.pipe # for issuing work
+ result = Cod.pipe # for receiving results
# Set up ten worker processes
pids = 10.times.map do |i|
@@ -214,8 +215,9 @@ Using _cod_, it boils down to this:
# Do something without worrying about signals
- # Here's the advantage of self-pipe: You can decide when
- # to listen for signals. Otherwise trap is very preemptive.
+ # Here's the advantage of self-pipe: You can
+ # decide when to listen for signals. Otherwise
+ # trap is very preemptive.
self_pipe.read.get # => :USR1
</code></pre>
Please sign in to comment.
Something went wrong with that request. Please try again.