Re: having standalone threads managed by netplex

Anil Madhavapeddy <[email protected]> Thu, 5 Feb 2009 15:48:13 +0000
Newsgroups gmane.comp.lang.ocaml.lib.net.devel
Message-ID <[email protected]>
On 4 Feb 2009, at 21:26, Jake Donham wrote:

> On Wed, Feb 4, 2009 at 12:34 PM, Anil Madhavapeddy <[email protected]>  
> wrote:
>
>> Is it possible in the Netplex framework to create these singleton
>> threads which exist outside of the actual protocol reactors?
>
> One detail is that in order to receive messages from the Netplex
> controller (in particular the shutdown message) you need to
> periodically yield control back to the event loop, by setting a timer
> to call you back. (With Lwt-equeue you can just use Lwt_unix.yield).

Thanks, this mostly worked great!  Defining a receive_message hook  
gives the very useful ability to dump out information using netplex- 
admin.

Oddly though, although I can call shutdown on the service, I can't  
seem to find a way to get it to restart the thread (post_start_hook is  
never called again, so it shuts down and stays down).  I'm guessing I  
need to mess around with the workload manager to prod it into making  
sure one service thread is always up.

Slowly getting my head round the framework :)

-anil

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com