Can an event state be serialized

  • Thread starter Thread starter jabailo
  • Start date Start date
J

jabailo

Suppose I have a windows service, with a FileWatcher class.

A file appears, and an event is raised -- but then the server is
rebooted or crashes.

When the server is rebooted, I want that event state to be where it was.

So, can an event be serialized?

And can it then be 're-raised' on the program that was responding to it?
 
Whether or not event arguments can be serialized depends on whether or
not the designer of the event and arguments class tagged the type with the
Serializable attribute. If they did not, then those events are not
serialized.

Also, by default, if the server crashes or goes down, you will lose that
information. The only way around that which I can think of would be to
store the event information in a transactional resource (such as a DB or
MSMQ) and have an external process process those entries. This way, you can
process them in a transactional environment, and if the server is restarted
or rebooted, then you can be assured that the events will be persisted.

Hope this helps.
 
Back
Top