Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

small doc fixes

  • Loading branch information...
commit 2a6d66c01058cc74d2839001057021247009e20c 1 parent b9f5af0
Ezra Zygmuntowicz authored
Showing with 20 additions and 36 deletions.
  1. +18 −19 README.rdoc
  2. +1 −16 lib/nanite/admin.rb
  3. +1 −1  lib/nanite/state.rb
View
37 README.rdoc
@@ -296,26 +296,25 @@ Mongrel on the other hand does not use EventMachine and therefore requires to wr
Using nanite with Passenger:
- current = Thread.current
- Thread.new do
- AMQP.start(:host => AMQP_HOST) do
- current.wakeup
- end
- end
- Thread.stop
-
- # catch these, stop AMQP, stop eventmachine, and re-throw to
-Mongrel/Passenger's signal traps
- EM.run do
- ['INT', 'TERM'].each do |sig|
- old = trap(sig) do
- AMQP.stop do
- EM.stop
- old.call
- end
- end
- end
+if defined?(PhusionPassenger)
+ PhusionPassenger.on_event(:starting_worker_process) do |forked|
+ if forked
+ if EM.reactor_running?
+ EM.stop_event_loop
+ EM.release_machine
+ EM.instance_variable_set( '@reactor_running', false )
end
+ Thread.current[:mq] = nil
+ AMQP.instance_variable_set('@conn', nil)
+ end
+
+ th = Thread.current
+ Thread.new{
+ Nanite.start_mapper(:host => 'localhost', :user => 'mapper', :pass => 'testing', :vhost => '/nanite', :log_level => 'info')
+ }
+ Thread.stop
+ end
+end
=======
Where to put the mapper initialization code depends on the framework and our preference.
View
17 lib/nanite/admin.rb
@@ -66,21 +66,6 @@ def layout(content=nil)
<meta content='Engineyard' name='author' />
<title>Nanite Control Tower</title>
- <!-- Google AJAX Libraries API -->
- <script src="http://www.google.com/jsapi"></script>
- <script type="text/javascript">
- google.load("jquery", "1");
- </script>
-
- <script type="text/javascript">
- $(document).ready(function(){
-
- // set the focus to the payload field
- $("#payload").focus();
-
- });
- </script>
-
<style>
body {margin: 0; font-family: verdana; background-color: #fcfcfc;}
ul {margin: 0; padding: 0; margin-left: 10px}
@@ -137,7 +122,7 @@ def layout(content=nil)
<div class="section">
#{"No nanites online." if @mapper.cluster.nanites.size == 0}
<ul>
- #{@mapper.cluster.nanites.map {|k,v| "<li>identity : #{k}<br />load : #{v[:status]}<br />services : #{v[:services].to_a.inspect}</li>" }.join}
+ #{@mapper.cluster.nanites.map {|k,v| "<li>identity : #{k}<br />load : #{v[:status]}<br />services : #{v[:services].to_a.inspect}<br />tags: #{v[:tags].to_a.inspect}</li>" }.join}
</ul>
</div>
<div id="footer">
View
2  lib/nanite/state.rb
@@ -17,7 +17,7 @@ class State
# service, so for each service the agent provides, we add the nanite to a SET
# of all the nanites that provide said service:
#
- # /gems/list: { nanite-foobar, nanite-nickelbag, nanite-another } # redis SET
+ # foo/bar: { nanite-foobar, nanite-nickelbag, nanite-another } # redis SET
#
# we do that same thing for tags:
# some-tag: { nanite-foobar, nanite-nickelbag, nanite-another } # redis SET
Please sign in to comment.
Something went wrong with that request. Please try again.