I think you can use (nil, true) as your arguments, or call MiddleMan.send_request(...).<br><br>The RailsWorkerProxy takes the first argument as the argument to pass to the method alive, and the second argument to be the synchronous flag. See RailsWorkerProxy#method_missing.<br>
<br>-todd[1]<br><br><div class="gmail_quote">On Thu, Apr 10, 2008 at 1:37 PM, Josh Symonds <<a href="mailto:veraticus@gmail.com">veraticus@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi everyone,<br><br>I have two workers, a connection_worker and an interface_worker, that I want to be able to call methods on each other. Initially I thought I could do this:<br><br>connection_worker<br> def alive?<br> return true<br>
end<br>end<br><br>interface_worker<br> def test_connection<br> if MiddleMan.worker(:connection_worker).alive?(true)<br> return true<br> end<br> end<br>end<br><br>Obviously this is a somewhat contrived test but I was just trying to make sure everything worked. I use alive?(true) because, according to <a href="http://backgroundrb.rubyforge.org/rails/index.html" target="_blank">http://backgroundrb.rubyforge.org/rails/index.html</a>, passing true should cause the worker to wait for a result and return that result. Unfortunately that doesn't seem to be the cause: every time I run this method I get nil back from the connection_worker. I know that in this specific case I could just check whether the connection_worker is running, but what I'm really trying to test here is how to communicate between the two workers, not whether the connection_worker is alive.<br>
<br>So I'm wondering what the best way to communicate between these workers is. I took a look at the advanced stuff and I think that maybe connect and start_server could work for me, but the documentation on them leaves me confused as to how to actually implement them. Any suggestions or help would be much appreciated.<br>
<font color="#888888">
<br>Josh<br>
</font><br>_______________________________________________<br>
Backgroundrb-devel mailing list<br>
<a href="mailto:Backgroundrb-devel@rubyforge.org">Backgroundrb-devel@rubyforge.org</a><br>
<a href="http://rubyforge.org/mailman/listinfo/backgroundrb-devel" target="_blank">http://rubyforge.org/mailman/listinfo/backgroundrb-devel</a><br></blockquote></div><br>