diff --git a/src/content/blog/DecouplingElixirGenServers.md b/src/content/blog/DecouplingElixirGenServers.md index b7289bf..94e3768 100644 --- a/src/content/blog/DecouplingElixirGenServers.md +++ b/src/content/blog/DecouplingElixirGenServers.md @@ -488,11 +488,9 @@ We've also seen how tests become simpler due to the fact that each test suite be There are some drawbacks though: - Debugging becomes harder. - - You are introducing an extra layer of asynchronous broadcast messaging and therefore your elixir processes become harder to debug. - Event delivery is not ensured. - - If a subscriber goes down, Phoenix PubSub won't try to re-deliver lost events once the process restarts. - Depending on your situation you might want to implement a more complex pub-sub system that does its best to ensure event delivery. diff --git a/src/content/blog/RcMapRust.md b/src/content/blog/RcMapRust.md index 52e5cc4..adbe2f8 100644 --- a/src/content/blog/RcMapRust.md +++ b/src/content/blog/RcMapRust.md @@ -147,7 +147,7 @@ If you try to perform a write operation while holding a read reference, your `Da let topic = map.get(topic_name).unwrap(); // This will cause a deadlock! let _ = map.remove(topic_name); -} +} ``` #### Redefining RcMap @@ -267,7 +267,7 @@ where The implementation looks quite self-explanatory to me, but there are a few things to point here. -First, both the key and value need to be "clone-able", and that makes sense because we need to clone these values from the inner map into the `ObjectRef`. +First, both the key and value need to be "clone-able", and that makes sense because we need to clone these values from the inner map into the `ObjectRef`. We could perhaps use `Arc` to wrap both the key and the value to not enforce them to implement Clone, but I was not sure about it so this has simply been an implementation detail I've left this way. @@ -281,7 +281,7 @@ where K: Hash + Eq, { AlreadyExists(K, ObjectRef), -} +} ``` This check is done for consistency reasons, because an entry must only be removed by the last `ObjectRef` being dropped.