[racket] About DB and events

From: Eduardo Bellani (ebellani at gmail.com)
Date: Fri Feb 24 08:43:33 EST 2012

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello list.

I am building a deamon here that pings a postgres database to send
some messages. A bit like the following code:

(let check-loop
    ([unsent-messages (get-unsent-messages)]) ;; get messages from DB
  (for-each (? (message) (do-it! message)) unsent-messages)
  (sleep *interval*)
  (check-loop (get-unsent-messages)))

I'm thinking this would be a great task for an event, but I'm having
some trouble transforming a DB call into an event. Is it possible?
Feasible? Anyone can think of alternatives? That looping and sleeping
does not sound like a nice way to code this.


Thanks.
- -- 
Eduardo Bellani

fear is an alarm, not a compass.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAk9Hk/cACgkQSbLl0kCTjGn4HwCfTfYx7O2Svgs1fU/iozNaH1If
tp8An2BcNHjnkvXP5FlC5N/4MTzp1Jdr
=LY9m
-----END PGP SIGNATURE-----

Posted on the users mailing list.