On Wednesday, November 14, 2012 10:36:38 PM UTC+8, David Powell wrote:
>
> Are you using lein repl?
>
> lein has two processes, one for the repl, and one for the application.  In 
> my experience, on Windows, ctrl-C -ing a lein repl is supposed to terminate 
> the the application, but usually doesn't...  Quite annoying...  As a 
> workaround I usually end up having to kill off stray java processes with 
> task manager.
>

Yes, this is annoying.

But in my case, `run-jetty` didn't really block the `repl`, it's just the 
output of this function that makes me think so.
Usually when I run some start-server command in terminal, be it `python 
manage.py runserver` or `lein run`, I would use ctrl-C to stop the process.
`run-jetty` is just like other functions, it returns the server object.
 

>
> On Wed, Nov 14, 2012 at 4:33 AM, Satoru Logic <sator...@gmail.com<javascript:>
> > wrote:
>
>> Hi, all.
>>
>> I am playing with the `ring` library in `repl`. 
>>
>> After using `run-jetty` to start a server,
>> I typed `ctrl+c` to send the SIGINT signal,
>> this ended the `run-jetty` function, but it didn't kill the server:
>>
>> user=> (require '[ring.adapter.jetty :refer [run-jetty]])
>> user=> (require '[ring.util.response :refer [response]])
>> user=> (*run-jetty* (fn [request] (response "Hello world")) {:port 3000})
>> 2012-11-14 11:44:01.892:INFO:oejs.Server:jetty-7.6.1.v20120215
>> 2012-11-14 11:44:01.956:INFO:oejs.AbstractConnector:Started 
>> SelectChannelConnector@0.0.0.0:3000
>> ^C
>> user=> (*run-jetty* (fn [request] (response "Save the world")) {:port 
>> 3000}) ; now try to run it again
>> 2012-11-14 11:44:21.358:INFO:oejs.Server:jetty-7.6.1.v20120215
>> BindException Address already in use  sun.nio.ch.Net.bind (Net.java:-2)
>>
>> user=> 2012-11-14 11:44:21.370:WARN:oejuc.AbstractLifeCycle:FAILED 
>> SelectChannelConnector@0.0.0.0:3000: java.net.BindException: Address 
>> already in use
>> java.net.BindException: Address already in use
>>
>>
>> And I can still access the "Hello World" example with "localhost:3000".
>>
>> Is this a bug?
>>  
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com<javascript:>
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com <javascript:>
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to