On Thu, Sep 16, 2010 at 5:00 PM, Robert Melfing
<robert.melf...@gmail.com> wrote:
> Hi all,
>
> [and thanks for the great job!]
>
> Quick one about External Processes:
> I've done a dummy java program to test this feature.
> An infinite loop on readline() to printout what's passed in.
>
> But when I either stop or restart couchdb, my java process is never killed
> and keeps running.
>
> Should the external process exit() after each request? Or can it stay
> running,
> waiting for the next request?
>
> env:
> Ubuntu Karmic, couch 1.0.1
>
> local.ini:
> [external]
> test=java -jar /TestExtrernalProcesses/dist/TestExtrernalProcesses.jar
>
> [httpd_db_handlers]
> _test = {couch_httpd_external, handle_external_req, <<"test">>}
>
>
> cheers,
> Robert
>

Robert,

You need to observe proper unix semantics and exit the program when
stdin closes. Alternatively, if Java has API's for getting the parent
process id, you can use that as well for an indication on when to
close.

HTH,
Paul Davis

Reply via email to