Are events synchronous or asynchronous?

If I have an object with a related file folder and I delete the object, I want its file folder deleted too. So if I need to do these steps:

  1. Dispatch event to delete folder with the object parameter
  2. Delete object from DB

Will the event handler run and complete its code before step 2 and return to start step 2 or in parallel with it?

And are events worth the effort and resources in such cases? The code is cleaner but that’s about it. On the other hand I have to write 5 times more code for all event classes and their instantiators and event handlers. To write a single method in the object class to delete the folder is much quicker to me.

I expect that events have to be synchronous because in many cases the handlers can modify data and hence alter the behaviour of the firer. To achieve such the code firing the event would need to wait until all attached handlers have completed.

I wouldn’t anticipate a massive overhead of handling. For something like deleting a file and folder, the overhead of the actual deletion would likely be 10x or 100x that of handling the event.