NetHTTPd/Netplex subtasking

Pierre-Alexandre Voye <[email protected]> Thu, 10 Jan 2013 13:19:49 +0100
Newsgroups gmane.comp.lang.ocaml.lib.net.devel
Message-ID <CANnJ5GdW+X1brBUKn7hpPx1xNMvA0qoVpYdDFmyRJt3Vr8mWmw@mail.gmail.com>
--===============7979064302987101141==
Content-Type: multipart/alternative; boundary=047d7b343e3c35454204d2ee33e8

--047d7b343e3c35454204d2ee33e8
Content-Type: text/plain; charset=UTF-8

Hello,
I'm facing more and more a problem with my application which is based on
NetHTTPd/NetCGI.

My software is based on CGI entry point (url and arguments values). Each
CGI opens a memcache + postgreSQL connexion, makes his task, closes
memcache + postgreSQL connexion and return the result (a string of course,
most of the time JSON data).

I use Memcache for several reasons, partly because of my inability to
understand how to use shared memory despite the tutorial.

Some CGI are becoming to long to execute (more than 30s).
Usually, the result I need to return is calculated quickly (less than 15s),
but I need to make lot of treatments before returning it.

Thus, I'm looking for a way to return the result my client need, and
continuing all tasks I need. So, I need to launch an asynchronous task.

The ugly way I only see is to make my app calling itself by Http, give to
the CGI, all the information it need to continue the task.
But it is so ugly, I can't make it this way.

Is there a way to lauch a task asynchronously ?
Can I use a thread without risk ?

Regards,

P-A

-- 
---------------------
https://twitter.com/#!/ontologiae/
http://linuxfr.org/users/montaigne

--047d7b343e3c35454204d2ee33e8
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><div><div><div><div>Hello,<br></div>I&#39;m facing mo=
re and more a problem with my application which is based on NetHTTPd/NetCGI=
.<br><br></div>My software is based on CGI entry point (url and arguments v=
alues). Each CGI opens a memcache + postgreSQL connexion, makes his task, c=
loses memcache + postgreSQL connexion and return the result (a string of co=
urse, most of the time JSON data).<br>

<br></div><div>I use Memcache for several reasons, partly because of my ina=
bility to understand how to use shared memory despite the tutorial. <br></d=
iv><div><br></div>Some CGI are becoming to long to execute (more than 30s).=
<br>

Usually, the result I need to return is calculated quickly (less than 15s),=
 but I need to make lot of treatments before returning it.<br><br>Thus, I&#=
39;m looking for a way to return the result my client need, and continuing =
all tasks I need. So, I need to launch an asynchronous task.<br>

<br></div>The ugly way I only see is to make my app calling itself by Http,=
 give to the CGI, all the information it need to continue the task.<br></di=
v>But it is so ugly, I can&#39;t make it this way.<br><div><div><div><div>

<div><div><br></div><div>Is there a way to lauch a task asynchronously ?<br=
></div><div>Can I use a thread without risk ?<br><br></div><div>Regards,<br=
><br></div><div>P-A<br></div><div><br>-- <br>---------------------<br>
<a href=3D"https://twitter.com/#%21/ontologiae/" target=3D"_blank">https://=
twitter.com/#!/ontologiae/</a><br>
<a href=3D"http://linuxfr.org/users/montaigne" target=3D"_blank">http://lin=
uxfr.org/users/montaigne</a><br>
</div></div></div></div></div></div></div>

--047d7b343e3c35454204d2ee33e8--


--===============7979064302987101141==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
--===============7979064302987101141==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Ocamlnet-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ocamlnet-devel

--===============7979064302987101141==--