<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -5,4 +5,28 @@
 % This responder can modify the request, and is obligated to return
 % a pool and the request. You can just return it directly if you want.
 provide_pool(A, _GC, _SC) -&gt;
-  {resource_fountain:best_pool_for_details_match(details()), A}.
+  % I confess this approach is lazy, but I don't think it's slow.
+  case application:get_env(fuzed_frontend, current_pool) of
+    undefined -&gt; 
+      Pool = lookup_and_cache_pool(),
+      {Pool, A};
+    {ok, Pool} -&gt;
+      case is_remote_process_alive(Pool) of
+        true -&gt;
+          {Pool, A};
+        false -&gt; 
+          {lookup_and_cache_pool(), A}
+      end
+  end.
+
+lookup_and_cache_pool() -&gt;
+  Pool = resource_fountain:best_pool_for_details_match(details()),
+  application:set_env(fuzed_frontend, current_pool, Pool),
+  Pool.
+
+is_remote_process_alive(Pid) -&gt;
+  Node = node(Pid),
+  case rpc:call(Node, erlang, is_process_alive, [Pid]) of
+    {badrpc, _Reason} -&gt; false;
+    Result -&gt; Result
+  end.</diff>
      <filename>elibs/frontend_responder.erl</filename>
    </modified>
    <modified>
      <diff>@@ -4,10 +4,14 @@
 
 
 setup(Port, DocRoot, Responder) -&gt;
-  yaws_begin_server(yaws_global_configs(Port, DocRoot, Responder)).
+  yaws_begin_server(yaws_global_configs(Port, DocRoot, Responder, [])).
 
-yaws_global_configs(Port, DocRoot, Responder) -&gt; 
+setup(Port, DocRoot, Responder, AppMods) -&gt;
+  yaws_begin_server(yaws_global_configs(Port, DocRoot, Responder, AppMods)).
+
+yaws_global_configs(Port, DocRoot, Responder, AppMods) -&gt; 
   Y = yaws_config:yaws_dir(),
+  {AppModModules, Opaques} = prepare_appmod_data(AppMods),
   GC = #gconf{yaws_dir = Y,
               ebin_dir = [],
               include_dir = [],
@@ -27,10 +31,25 @@ yaws_global_configs(Port, DocRoot, Responder) -&gt;
               listen = {0,0,0,0},
               docroot = DocRoot, 
               errormod_404 = Responder,
-              appmods = []},
+              appmods = AppModModules,
+              opaque = Opaques},
   {GC,SC}.
 
 yaws_begin_server({GC,SC}) -&gt; 
   application:set_env(yaws, embedded, true),
   application:start(yaws),
   yaws_api:setconf(GC, [[SC]]).
+
+% Triples: {Path, module, Role}
+prepare_appmod_data(AppMods) when is_list(AppMods) -&gt;
+  lists:foldl(fun({Path, Module, Role}, {AMMM, Opaques}) -&gt; 
+                    {[{Path, Module}|AMMM], 
+                     [{{Path, Module}, [{&lt;&lt;&quot;roles&quot;&gt;&gt;, [to_binary(Role)]}]}|Opaques]}
+                end,
+                {[], []},
+                AppMods);
+prepare_appmod_data(_) -&gt; {[], []}.
+
+to_binary(String) when is_list(String) -&gt; list_to_binary(String);
+to_binary(Atom) when is_atom(Atom) -&gt; to_binary(atom_to_list(Atom));
+to_binary(Binary) when is_binary(Binary) -&gt; Binary.</diff>
      <filename>elibs/frontend_yaws.erl</filename>
    </modified>
    <modified>
      <diff>@@ -22,6 +22,7 @@ init([]) -&gt;
   Master = application:get_env(master),
   {ok, DocRoot} = application:get_env(docroot),
   {ok, Port} = application:get_env(port),
+  AppModSpecs = process_appmods(application:get_env(appmods)),
   ResponderModule = figure_responder(),
   case Master of
     {ok, MasterNode} -&gt;
@@ -29,7 +30,7 @@ init([]) -&gt;
     undefined -&gt;
       MasterNode = node()
   end,
-  frontend_yaws:setup(Port, DocRoot, ResponderModule),
+  frontend_yaws:setup(Port, DocRoot, ResponderModule, AppModSpecs),
   {ok, {{one_for_one, 10, 600},
         [{master_beater,
           {master_beater, start_link, [MasterNode, ?GLOBAL_TIMEOUT, ?SLEEP_CYCLE]},
@@ -60,3 +61,5 @@ figure_responder() -&gt;
     undefined -&gt; frontend_responder
   end.
       
+process_appmods(undefined) -&gt; [];
+process_appmods({ok, V}) -&gt; V.</diff>
      <filename>elibs/fuzed_frontend_supervisor.erl</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,5 @@
-bin/fuzed start -n master@volcano.local
+bin/fuzed start -n master@chisai.local
 
-bin/fuzed frontend -z volcano.local -r test/app/public -s 'kind=rails|roles=production' -n f1@volcano.local
+bin/fuzed frontend -z chisai.local -r test/app/public -s 'kind=rails|roles=production' -n f1@chisai.local
 
-bin/fuzed join -z volcano.local -f rlibs/rails_node.rb -n n1@volcano.local -p
+bin/fuzed join -z chisai.local -f rlibs/rails_node.rb -n n1@chisai.local -p</diff>
      <filename>test/commands.txt</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>web/index.html~</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>0f6b09930784a37191dea47fb2b19559e192e657</id>
    </parent>
  </parents>
  <author>
    <name>David Fayram</name>
    <email>dfayram@gmail.com</email>
  </author>
  <url>http://github.com/KirinDave/fuzed/commit/aa1bf85d30bc31f7be87b7d2ccb3d560daa18ad1</url>
  <id>aa1bf85d30bc31f7be87b7d2ccb3d560daa18ad1</id>
  <committed-date>2008-05-25T16:40:09-07:00</committed-date>
  <authored-date>2008-05-25T16:40:09-07:00</authored-date>
  <message>Working on a better, more configurable frontnet.\n I can't help but wonder if maybe going back to the config file was a smarter idea tho.</message>
  <tree>013e6f1c97b917a08db983e6b03c8d33ee4864ee</tree>
  <committer>
    <name>David Fayram</name>
    <email>dfayram@gmail.com</email>
  </committer>
</commit>
