[erlang-questions] gen_cron question

Logan, Martin Martin.Logan@REDACTED
Tue Mar 4 17:12:31 CET 2008


Is there a reason you don't just use gen_server with a timeout?  Init
would return {ok, State, Timeout} and then you would run your task out
of handle_info(timeout, State) -> ...

 

Cheers,

Martin

 

________________________________

From: erlang-questions-bounces@REDACTED
[mailto:erlang-questions-bounces@REDACTED] On Behalf Of db
Sent: Sunday, March 02, 2008 11:54 AM
To: erlang-questions@REDACTED
Subject: [erlang-questions] gen_cron question

 

I need to purge 10 mnesia tables on day/hourly interval.  I am looking
at http://code.google.com/p/gencron/ to accomplish this.  Documentation
says gen_cron pretty much like gen_server. I am not an expert in
gen_server.  I want to create 1 process for each table to perform
purging.

Do I create 10 process intially and have them sleep on the interval or
gen_cron starts these 10 process on interval?

Any sample gen_cron example out there?

Gen_cron seems to consider a task as a module.  What if I want to run
two different modules, do I start two different gen_cron with two
different name? 


-- 
rk

That which we persist in doing becomes easier for us to do; not that the
nature of the thing itself is changed, but that our power to do is
increased.
-Ralph Waldo Emerson 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080304/28beb42d/attachment.htm>


More information about the erlang-questions mailing list