This depends how much work you want to put into it and how robust you want
our queue.
if you dont care that the queue goes away when the worker process for your
web app shuts down, then you can do it all in your asp.net code and not have
to use an external queue.
if you dont want to deal with msmq, you can have a simple app running that
handles the queue and use any of the various mechanisms to communicate with
it (sockets, remoting, etc).
or... use msmq but you wanted something more lightweight.
there is no built in data structure to do what you want 'totally' .. however
you just want a sorted list it sounds. in addition you will just need code
to expire an event that would check for that upon each request for a
particular event.
so use the sortedlist class. if you really want to do the last 20 events and
dont care about anything except the order an event was added, you can just
use the queue class.
dont forget to lock the queue as well for updates. If every browser is
updating it and reading it right around the same time, use a full lock on
the quue. if some are only reading while some are only writing use a
ReadWriterLockSlim class
if you dont want to deal with msmq and speed of using a database isnt a
concern you can easily implement in sql server as well with a table with
event id and a table containing information for 'what browsers have received
what events' with a process that runs every X amount of time to clean up
this data or the browsers call can do it although one could argue then may
as well just use msmq, but some people dont like dealing with msmq.

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to