You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My understanding of the earlier Todo.Database.choose_worker/1 was to ensure only 1 worker ever touched a database file at a time (ie avoid collisions writing to the files). In 11.2 the database components are altered to have a pool of 3 workers, but there's no longer anything preventing file collisions.
The point of the exercise was to switch over to using a dependency, but I was wondering if my assertions above are correct or if I missed something.
(BTW, this book is really good and I appreciate the github repo with full examples!)
The text was updated successfully, but these errors were encountered:
Yes, you're spot on! It doesn't matter in the grand scheme of things, because all the operations are channeled through the todo genservers, which ensures we won't be touching the same file from different db workers.
TBH, I picked hashing in the first implementation primarily because it's much simpler to implement than the poolboy version which requires tracking idle vs busy workers, and so it would be a much more demanding exercise.
My understanding of the earlier
Todo.Database.choose_worker/1
was to ensure only 1 worker ever touched a database file at a time (ie avoid collisions writing to the files). In 11.2 the database components are altered to have a pool of 3 workers, but there's no longer anything preventing file collisions.The point of the exercise was to switch over to using a dependency, but I was wondering if my assertions above are correct or if I missed something.
(BTW, this book is really good and I appreciate the github repo with full examples!)
The text was updated successfully, but these errors were encountered: