Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lein repl timeout #2

Open
wants to merge 3 commits into
base: a-minimal-client
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
:output-dir "target/classes/public/js/chat-demo"
:optimizations :none
:source-map true}}]}
:repl-options {:init-ns user
:repl-options {:timeout 120000
:init-ns user
:init (start)
:welcome (do
(println "Welcome to the core.async tutorial!")
Expand Down
4 changes: 2 additions & 2 deletions resources/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h2 id="welcome">Welcome</h2>
<h2>Requirements</h2>
</header>
<p>
In order to complete this course, you will need this following:
In order to complete this course, you will need the following:
</p>
<ul>
<li>Familiarity with the Clojure/ClojureScript programming language</li>
Expand Down Expand Up @@ -64,4 +64,4 @@ <h2>Getting started</h2>
</ol>
</section>
</article>
</template>
</template>
8 changes: 4 additions & 4 deletions resources/templates/reference/primitives.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ <h2>About core.async</h2>
The historical roots of core.async trace all the way back to Hoare’s <a href="http://usingcsp.com/">Communicating
Sequential Processes</a> (CSP). One of the most immediate inspirations for core.async is the
<a href="http://golang.org/">Go programming language</a>. Fundamentally, one of the principles behind CSP is
that coordination between concurrent processes is achieved via message-passing. In core.async, this achieved
that coordination between concurrent processes is achieved via message-passing. In core.async, this is achieved
through the use of queue-like <em>channels</em>.
</p>

Expand Down Expand Up @@ -57,7 +57,7 @@ <h2>Channels</h2>

<dt>…between logical threads of execution…</dt>
<dd>
While channels are certainly useful for coordinating between threads, they do no require actual
While channels are certainly useful for coordinating between threads, they do not require actual
OS-level threads to work. They are usable within ClojureScript, which has only a single thread of
execution. In fact, the most common use case does not require dedicated threads.
</dd>
Expand Down Expand Up @@ -260,7 +260,7 @@ <h3>A simple example</h3>
<p>
Nonetheless, this asynchronous variant would work just fine in ClojureScript. The only price we have to pay
is a small sampling of callback hell. But what if there was a way to maintain the readability of the
synchronous function buy still enjoy the benefits of asynchronous operation? Well, let’s check out what
synchronous function but still enjoy the benefits of asynchronous operation? Well, let’s check out what
<code>go</code> can do for us:
</p>

Expand Down Expand Up @@ -320,4 +320,4 @@ <h3>More <code>go</code></h3>
</section>
</article>

</template>
</template>
10 changes: 5 additions & 5 deletions resources/templates/tutorial/a-minimal-client.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,14 @@ <h2>About event loops</h2>

<p>
The <code>&lt;!</code> function takes a value from the channel. This function can only be used in the
context context of a <code>go</code>. This will allow the loop to park until it has a value. It’s
nice because it allow you to write code to appear as if the code blocks at that point without actually
context of a <code>go</code>. This will allow the loop to park until it has a value. It’s
nice because it allows you to write code to appear as if the code blocks at that point without actually
blocking.
</p>

<p>
We use a <code>when-let</code> because the channel will always produce a non-null value. If we get a
null value, that indicates the channel was closed. This also means you can not put a null value into
null value, that indicates the channel was closed. This also means you cannot put a null value into
a channel. If there is a chance the channel will produce a <code>false</code> value, you can use
<code>when-some</code> instead, which was introduced in Clojure 1.6.
</p>
Expand Down Expand Up @@ -166,7 +166,7 @@ <h2>Clean things up</h2>
Once you have a running event loop, there is one last thing we should probably do. We should close
the channel once we're done with it. This will cause the event loop we created to terminate cleanly
and be garbage-collected. To do this, all you need to do is call <code>close!</code> on the channel.
This idempotent call will cause the channel to longer accept new values, but will allow readers to
This idempotent call will cause the channel to no longer accept new values, but will allow readers to
continue reading values until the channel is exhausted.
</p>
</section>
Expand All @@ -190,4 +190,4 @@ <h2>Summary</h2>
</a>
</section>
</article>
</template>
</template>
6 changes: 3 additions & 3 deletions resources/templates/tutorial/chat-together.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ <h3><code>mult</code> in practice</h3>
</p>

<p>
Now the only bit of functionality you will need to use in mult-channel properly is to ensure that when
the client disconnects you shut down things down properly:
Now the only bit of functionality you will need to use a mult-channel properly is to ensure that when
the client disconnects you shut things down properly:
</p>
<pre class="brush: clojure">(async/untap! subscribe-channel chat-events)
(async/close! chat-events)</pre>
Expand All @@ -127,4 +127,4 @@ <h2>Summary</h2>
and introduction of new concepts.
</p>
</section>
</template>
</template>
6 changes: 3 additions & 3 deletions resources/templates/tutorial/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ <h3>Code structure</h3>
<ul>
<li>
All of the code related to the chat demo and tutorial is under the
<code>async-workshop.chat-demo</code> namespace. The client (ClojureScript) code will be under
<code>async-workshop.chat-demo.client</code>, and the server (Clojure) code will be under
<code>async-workshop.chat-demo</code> namespace. The client (ClojureScript) code is under
<code>async-workshop.chat-demo.client</code>, and the server (Clojure) code is under
<code>async-workshop.chat-demo.server</code>.
</li>
<li>
Expand Down Expand Up @@ -126,4 +126,4 @@ <h2>Develop the code</h2>
<paper-button label="Build a minimal client" class="inverse" raisedbutton></paper-button>
</a>
</section>
</template>
</template>
8 changes: 4 additions & 4 deletions resources/templates/tutorial/sending-a-message.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ <h2>Add an input component</h2>
<pre class="brush: clojure">(om/root chat-input-widget app-state
{:target (.getElementById js/document "chatInputWidget")})</pre>
<p>
Note that in this example, the <code>chat-input-widget</code> var has ben referred.
Note that in this example, the <code>chat-input-widget</code> var has been referred.
</p>
</section>

Expand Down Expand Up @@ -113,7 +113,7 @@ <h2>Add a message channel</h2>
<h2>Produce the message</h2>

<p>
Now that there is a place to put the message, let’s modify <code>send-message</code> to the job. The
Now that there is a place to put the message, let’s modify <code>send-message</code> to do the job. The
code for this is fairly straightforward. Just dereference the cursor passed in to get access to the
channel:
</p>
Expand Down Expand Up @@ -162,7 +162,7 @@ <h2>Consume the message</h2>
<h2>Summary</h2>

<p>
In this section, we’ve primary learned how to use multiple channels together using <code>alts!</code>.
In this section, we’ve primarily learned how to use multiple channels together using <code>alts!</code>.
In the next section, we’ll start seeing how we can use this technique together with several other
new ones to get multiple clients actually talking to each other.
</p>
Expand All @@ -171,4 +171,4 @@ <h2>Summary</h2>
</a>
</section>
</article>
</template>
</template>