Ok,
This is working, so far. However I'm not sure on the bus creation and
the cost associated with it.
Daniel suggested here :
http://groups.google.com/group/ravendb/browse_thread/thread/a758e82fbca84bfc
(or asked for a best practice advise) using an asynch task to perform
the heavy stuff, which I tend to agree with.
On the other hand, I need to send the message to the bus IF the action
is successfully performed on RavenDB, meaning I don't want to send a
delete message if the document deletion was rolled back. Same for a
put.
That being said, I think I can use the following approaches:
OnPut + Synchronous message delivery on the same transaction.
OnAfterCommit + Asynchronous message delivery, since I have the
warranty that the document was successfully written.
On the delete side I have no options but stick with OnDelete, since I
_do_ need information from the document to be included on the message.
Does this sounds reasonable?