Note that there are some explanatory texts on larger screens.

plurals
  1. POCQRS run handlers in specific order
    text
    copied!<p>I have a running order for 2 handlers Deleting and Reordering pictures and would like some advises for the best solution. </p> <p>On the UI some pictures are deleted, the user clicks on the deleted button. The whole flow, delete command up to an event handler which actually deletes the physical files is started. </p> <p>Then immediately the user sorts the remaining pictures. A new flow from reorder command up to the reordering event handler for the file system fires again. </p> <p>Already there is a concurrency problem. The reordering cannot be correctly applied without having the deletion done. At the moment this problem is handled with some sort of lock. A temp file is created and then deleted at the end of the deletion flow. While that file exists the other thread (reordering or deletion depending on the user actions) awaits. </p> <p>This is not an ideal solution and would like to change it. The potential solution must be also pretty fast (off course the current one is not a fast one) as the UI is updated thru a JSON call at the end of ordering. </p> <p>In a later implementation we are thinking to use a queue of events but for the moment we are pretty stuck. </p> <p>Any idea would be appreciated! Thank you, mosu'!</p> <p>Edit: Other eventual consistency problems that we had were solved by using a Javascript data manager on the client side. Basically being optimist and tricking the user! :) I'm starting to believe this is the way to go here as well. But then how would I know when is the data changed in the file system? </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload