[zeromq-dev] event based messaging system

Thomas Rodgers rodgert at twrodgers.com
Fri Dec 12 13:35:56 CET 2014

You don't need a timer per request. A typical way to do this sort of
scheduling is to keep a queue ordered by event time, by inserting each new
event into the queue by comparing event times. You set your single timer's
expiration for the event closest to now (eg the head of the queue). When
that event timer expires, you publish your notification, pop the head of
the queue and set the timer to the next nearest event time.

On Friday, December 12, 2014, Vishal Ahuja <vahuja4 at gmail.com> wrote:

> I am trying to design an event based messaging system which works as
> follows:
> Let us say that there are multiple products in a store, and their prices
> vary every day. Clients can login to the application, and request to know
> (via SMS) the price of a particular product on a particular date (say 1
> month from the date of login).
> The application will not have access to a database. It will have to
> retrieve the information from a web page. So let us say that the user wants
> to know the price of a product on the 1st of Jan, then the application will
> have to access the website on that particular day itself. Also, another
> detail is that the price of the product can be changed any time during the
> day.
> I am not sure how to design this using zeromq, particularly I am not sure
> how to receive a client request and then act on it after a month or so.
> Will I have to start a timer for every request? Please help me with the
> design.
> Sincerely,
> Vishal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20141212/2c68d813/attachment.htm>

More information about the zeromq-dev mailing list