in reply to Database poller

If your rdbms supports it, stored procedures would speed things up. A trigger on insertion would let you avoid polling.

Do you remove messages as they are read? If not, a timestamp or 'seen' flag would let you reduce the size of responses.

After Compline,
Zaxo

Replies are listed 'Best First'.
Re: Re: Database poller
by Marcello (Hermit) on Jun 15, 2003 at 08:21 UTC
    Hi Zaxo,

    I'm using MySQL so stored procedures and triggers are not yet supported unfortunately.

    I am deleting records when they are processed, so the database table is nearly always empty.

    Maybe another intermediate database table could help? I was thinking of a table where the main process (which accepts the clients) stores the currently active client processes including their process id. So if the database process finds a message, it checks the process table to see if the client to which the message should be delivered is currently logged in. All it has to do after that is signal the process that there are messages waiting.

    Maybe this is a good approach?

    Regards,
    Marcel